#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 158 of file Constraint_Nodes.h.
|
Definition at line 211 of file Constraint_Nodes.cpp. References TAO_Expression_Type.
|
|
Definition at line 218 of file Constraint_Nodes.cpp. References operand_.
00219 { 00220 delete operand_; 00221 } |
|
|
|
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 225 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().
00226 { 00227 // Since there are only three unary operators, there's no need for a 00228 // dispatch table. 00229 int return_value = -1; 00230 switch (this->op_) 00231 { 00232 case TAO_CONSTRAINT: 00233 return_value = visitor->visit_constraint (this); 00234 break; 00235 case TAO_WITH: 00236 return_value = visitor->visit_with (this); 00237 break; 00238 case TAO_MIN: 00239 return_value = visitor->visit_min (this); 00240 break; 00241 case TAO_MAX: 00242 return_value = visitor->visit_max (this); 00243 break; 00244 case TAO_NOT: 00245 return_value = visitor->visit_not (this); 00246 break; 00247 case TAO_UMINUS: 00248 return_value = visitor->visit_unary_minus (this); 00249 break; 00250 case TAO_EXIST: 00251 return_value = visitor->visit_exist (this); 00252 break; 00253 } 00254 00255 return return_value; 00256 } |
|
Return the expression type represented by this node.
Implements TAO_Constraint. Definition at line 169 of file Constraint_Nodes.h. References TAO_Expression_Type.
00170 { return this->op_; } |
|
|
|
|
The operator type.
Definition at line 180 of file Constraint_Nodes.h. |
|
The operand of the expression.
Definition at line 183 of file Constraint_Nodes.h. Referenced by operand(), and ~TAO_Unary_Constraint(). |