3131
3232namespace iceberg {
3333
34- // / \brief Type alias for shared pointer to Expression
35- class Expression ;
36- using ExpressionPtr = std::shared_ptr<Expression>;
37-
3834// / \brief Represents a boolean expression tree.
3935class ICEBERG_EXPORT Expression {
4036 public:
@@ -71,7 +67,7 @@ class ICEBERG_EXPORT Expression {
7167 virtual Operation op () const = 0;
7268
7369 // / \brief Returns the negation of this expression, equivalent to not(this).
74- virtual Result<ExpressionPtr > Negate () const {
70+ virtual Result<std::shared_ptr<Expression> > Negate () const {
7571 return unexpected (
7672 Error (ErrorKind::kInvalidExpression , " Expression cannot be negated" ));
7773 }
@@ -99,7 +95,7 @@ class ICEBERG_EXPORT True : public Expression {
9995
10096 std::string ToString () const override { return " true" ; }
10197
102- Result<ExpressionPtr > Negate () const override ;
98+ Result<std::shared_ptr<Expression> > Negate () const override ;
10399
104100 bool Equals (const Expression& other) const override {
105101 return other.op () == Operation::kTrue ;
@@ -119,7 +115,7 @@ class ICEBERG_EXPORT False : public Expression {
119115
120116 std::string ToString () const override { return " false" ; }
121117
122- Result<ExpressionPtr > Negate () const override ;
118+ Result<std::shared_ptr<Expression> > Negate () const override ;
123119
124120 bool Equals (const Expression& other) const override {
125121 return other.op () == Operation::kFalse ;
@@ -137,31 +133,31 @@ class ICEBERG_EXPORT And : public Expression {
137133 public:
138134 // / \brief Constructs an And expression from two sub-expressions.
139135 // /
140- // / @ param left The left operand of the AND expression
141- // / @ param right The right operand of the AND expression
142- And (ExpressionPtr left, ExpressionPtr right);
136+ // / \ param left The left operand of the AND expression
137+ // / \ param right The right operand of the AND expression
138+ And (std::shared_ptr<Expression> left, std::shared_ptr<Expression> right);
143139
144140 // / \brief Returns the left operand of the AND expression.
145141 // /
146- // / @ return The left operand of the AND expression
147- const ExpressionPtr & left () const { return left_; }
142+ // / \ return The left operand of the AND expression
143+ const std::shared_ptr<Expression> & left () const { return left_; }
148144
149145 // / \brief Returns the right operand of the AND expression.
150146 // /
151- // / @ return The right operand of the AND expression
152- const ExpressionPtr & right () const { return right_; }
147+ // / \ return The right operand of the AND expression
148+ const std::shared_ptr<Expression> & right () const { return right_; }
153149
154150 Operation op () const override { return Operation::kAnd ; }
155151
156152 std::string ToString () const override ;
157153
158- Result<ExpressionPtr > Negate () const override ;
154+ Result<std::shared_ptr<Expression> > Negate () const override ;
159155
160156 bool Equals (const Expression& other) const override ;
161157
162158 private:
163- ExpressionPtr left_;
164- ExpressionPtr right_;
159+ std::shared_ptr<Expression> left_;
160+ std::shared_ptr<Expression> right_;
165161};
166162
167163} // namespace iceberg
0 commit comments