TAO_CosTrader
2.2.0
|
TAO_Constraint_Interpreter will, given a constraint string whose syntax and semantics comply with the trader specification for the constraint language, determine if a CosTrading::Offer meets the constraints. More...
#include <Constraint_Interpreter.h>
Public Member Functions | |
TAO_Constraint_Interpreter (const CosTradingRepos::ServiceTypeRepository::TypeStruct &ts, const char *constraints) | |
TAO_Constraint_Interpreter (TAO_Constraint_Validator &validator, const char *constraints) | |
~TAO_Constraint_Interpreter (void) | |
Destructor. More... | |
CORBA::Boolean | evaluate (CosTrading::Offer *offer) |
CORBA::Boolean | evaluate (TAO_Constraint_Evaluator &evaluator) |
Additional Inherited Members | |
Protected Member Functions inherited from TAO_Interpreter | |
TAO_Interpreter (void) | |
Constructor. More... | |
~TAO_Interpreter (void) | |
Destructor. More... | |
int | build_tree (const char *preferences) |
Static Protected Member Functions inherited from TAO_Interpreter | |
static int | is_empty_string (const char *str) |
Protected Attributes inherited from TAO_Interpreter | |
TAO_Constraint * | root_ |
TAO_Constraint_Interpreter will, given a constraint string whose syntax and semantics comply with the trader specification for the constraint language, determine if a CosTrading::Offer meets the constraints.
TAO_Constraint_Interpreter will first build an expression tree representing the constraint expression using Lex and Yacc. Then, using a TAO_Constraint_Validator, it will validate the semantic correctness of the tree. When the evaluate method is invoked with an Offer, the TAO_Constraint_Interpreter will construct an EvaluationVisitor, which will evaluate the tree and decide whether the offer meets the constraints.
TAO_Constraint_Interpreter::TAO_Constraint_Interpreter | ( | const CosTradingRepos::ServiceTypeRepository::TypeStruct & | ts, |
const char * | constraints | ||
) |
TAO_Constraint_Interpreter::TAO_Constraint_Interpreter | ( | TAO_Constraint_Validator & | validator, |
const char * | constraints | ||
) |
This constructor builds an expression tree representing the constraint specified in <constraints>, and throws an Illegal Constraint exception if the constraint given has syntax errors or semantic errors, such as mismatched types.
TAO_Constraint_Interpreter::~TAO_Constraint_Interpreter | ( | void | ) |
Destructor.
CORBA::Boolean TAO_Constraint_Interpreter::evaluate | ( | CosTrading::Offer * | offer | ) |
CORBA::Boolean TAO_Constraint_Interpreter::evaluate | ( | TAO_Constraint_Evaluator & | evaluator | ) |