From eb3c7dd562b48c0d7f7caf269bb75d031ea25daf Mon Sep 17 00:00:00 2001 From: Aiee <18348405+Aiee@users.noreply.github.com> Date: Wed, 21 Jul 2021 19:45:44 +0800 Subject: [PATCH] add isContainerExpr() interface --- src/common/expression/ContainerExpression.h | 12 ++++++++++++ src/common/expression/Expression.h | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/common/expression/ContainerExpression.h b/src/common/expression/ContainerExpression.h index 236e3bd17..e3f675bdc 100644 --- a/src/common/expression/ContainerExpression.h +++ b/src/common/expression/ContainerExpression.h @@ -115,6 +115,10 @@ class ListExpression final : public Expression { return ListExpression::make(pool_, items); } + bool isContainerExpr() const override { + return true; + } + private: explicit ListExpression(ObjectPool *pool) : Expression(pool, Kind::kList) {} @@ -181,6 +185,10 @@ class SetExpression final : public Expression { return SetExpression::make(pool_, items); } + bool isContainerExpr() const override { + return true; + } + private: explicit SetExpression(ObjectPool *pool) : Expression(pool, Kind::kSet) {} @@ -247,6 +255,10 @@ class MapExpression final : public Expression { return MapExpression::make(pool_, items); } + bool isContainerExpr() const override { + return true; + } + private: explicit MapExpression(ObjectPool *pool) : Expression(pool, Kind::kMap) {} diff --git a/src/common/expression/Expression.h b/src/common/expression/Expression.h index 873e06346..6fb379232 100644 --- a/src/common/expression/Expression.h +++ b/src/common/expression/Expression.h @@ -168,6 +168,10 @@ class Expression { return false; } + virtual bool isContainerExpr() const { + return false; + } + protected: class Encoder final { public: