00001 // Notify_Constraint_Interpreter.cpp,v 1.13 2006/03/14 06:14:34 jtc Exp 00002 00003 #include "orbsvcs/Notify/Notify_Constraint_Interpreter.h" 00004 #include "orbsvcs/Notify/Notify_Constraint_Visitors.h" 00005 00006 ACE_RCSID(Notify, NS_Constraint_Interpreter, "Notify_Constraint_Interpreter.cpp,v 1.13 2006/03/14 06:14:34 jtc Exp") 00007 00008 00009 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00010 00011 TAO_Notify_Constraint_Interpreter::TAO_Notify_Constraint_Interpreter (void) 00012 { 00013 } 00014 00015 TAO_Notify_Constraint_Interpreter::~TAO_Notify_Constraint_Interpreter (void) 00016 { 00017 } 00018 00019 void 00020 TAO_Notify_Constraint_Interpreter::build_tree ( 00021 const char *constraints 00022 ACE_ENV_ARG_DECL 00023 ) 00024 ACE_THROW_SPEC ((CosNotifyFilter::InvalidConstraint, 00025 CORBA::NO_MEMORY)) 00026 { 00027 if (TAO_ETCL_Interpreter::is_empty_string (constraints)) 00028 { 00029 // Root is deleted in the TAO_Interpreter's destructor. 00030 ACE_NEW_THROW_EX (this->root_, 00031 TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1), 00032 CORBA::NO_MEMORY ()); 00033 ACE_CHECK; 00034 } 00035 else 00036 { 00037 // root_ is set in this base class call. 00038 if (TAO_ETCL_Interpreter::build_tree (constraints) != 0) 00039 ACE_THROW (CosNotifyFilter::InvalidConstraint ()); 00040 } 00041 } 00042 00043 CORBA::Boolean 00044 TAO_Notify_Constraint_Interpreter::evaluate (TAO_Notify_Constraint_Visitor &evaluator) 00045 { 00046 return evaluator.evaluate_constraint (this->root_); 00047 } 00048 00049 TAO_END_VERSIONED_NAMESPACE_DECL