00001 // $Id: Notify_Constraint_Interpreter.cpp 77001 2007-02-12 07:54:49Z johnnyw $ 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, "$Id: Notify_Constraint_Interpreter.cpp 77001 2007-02-12 07:54:49Z johnnyw $") 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 ) 00023 { 00024 if (TAO_ETCL_Interpreter::is_empty_string (constraints)) 00025 { 00026 // Root is deleted in the TAO_Interpreter's destructor. 00027 ACE_NEW_THROW_EX (this->root_, 00028 TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1), 00029 CORBA::NO_MEMORY ()); 00030 } 00031 else 00032 { 00033 // root_ is set in this base class call. 00034 if (TAO_ETCL_Interpreter::build_tree (constraints) != 0) 00035 throw CosNotifyFilter::InvalidConstraint (); 00036 } 00037 } 00038 00039 CORBA::Boolean 00040 TAO_Notify_Constraint_Interpreter::evaluate (TAO_Notify_Constraint_Visitor &evaluator) 00041 { 00042 return evaluator.evaluate_constraint (this->root_); 00043 } 00044 00045 TAO_END_VERSIONED_NAMESPACE_DECL