#include <Constraint_Nodes.h>
Inheritance diagram for TAO_Unary_Constraint:
Public Member Functions | |
TAO_Unary_Constraint (TAO_Expression_Type op_type, TAO_Constraint *operand) | |
virtual | ~TAO_Unary_Constraint (void) |
virtual int | accept (TAO_Constraint_Visitor *visitor) |
virtual TAO_Expression_Type | expr_type (void) const |
Return the expression type represented by this node. | |
TAO_Constraint * | operand (void) |
Private Member Functions | |
TAO_Unary_Constraint (const TAO_Unary_Constraint &) | |
TAO_Unary_Constraint & | operator= (const TAO_Unary_Constraint &) |
Private Attributes | |
TAO_Expression_Type | op_ |
The operator type. | |
TAO_Constraint * | operand_ |
The operand of the expression. |
Definition at line 160 of file Constraint_Nodes.h.
|
Definition at line 210 of file Constraint_Nodes.cpp. References TAO_Expression_Type.
|
|
Definition at line 217 of file Constraint_Nodes.cpp. References operand_.
00218 { 00219 delete operand_; 00220 } |
|
|
|
Implementing the pattern of double dispatching, each subclass of TAO_Constraint will call back on an InterpreterVisitor the method to handle a node of its ExpressionType. Implements TAO_Constraint. Definition at line 224 of file Constraint_Nodes.cpp. References TAO_CONSTRAINT, TAO_EXIST, TAO_MAX, TAO_MIN, TAO_NOT, TAO_UMINUS, TAO_WITH, TAO_Constraint_Visitor::visit_constraint(), TAO_Constraint_Visitor::visit_exist(), TAO_Constraint_Visitor::visit_max(), TAO_Constraint_Visitor::visit_min(), TAO_Constraint_Visitor::visit_not(), TAO_Constraint_Visitor::visit_unary_minus(), and TAO_Constraint_Visitor::visit_with().
00225 { 00226 // Since there are only three unary operators, there's no need for a 00227 // dispatch table. 00228 int return_value = -1; 00229 switch (this->op_) 00230 { 00231 case TAO_CONSTRAINT: 00232 return_value = visitor->visit_constraint (this); 00233 break; 00234 case TAO_WITH: 00235 return_value = visitor->visit_with (this); 00236 break; 00237 case TAO_MIN: 00238 return_value = visitor->visit_min (this); 00239 break; 00240 case TAO_MAX: 00241 return_value = visitor->visit_max (this); 00242 break; 00243 case TAO_NOT: 00244 return_value = visitor->visit_not (this); 00245 break; 00246 case TAO_UMINUS: 00247 return_value = visitor->visit_unary_minus (this); 00248 break; 00249 case TAO_EXIST: 00250 return_value = visitor->visit_exist (this); 00251 break; 00252 } 00253 00254 return return_value; 00255 } |
|
Return the expression type represented by this node.
Implements TAO_Constraint. Definition at line 171 of file Constraint_Nodes.h. References TAO_Expression_Type.
00172 { return this->op_; } |
|
|
|
|
The operator type.
Definition at line 182 of file Constraint_Nodes.h. |
|
The operand of the expression.
Definition at line 185 of file Constraint_Nodes.h. Referenced by operand(), and ~TAO_Unary_Constraint(). |