1 #include "ace/Monitor_Control/Constraint_Interpreter.h"
3 #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
5 #include "ace/Log_Category.h"
7 #include "ace/ETCL/ETCL_Constraint.h"
9 #include "ace/Monitor_Control/Constraint_Visitor.h"
11 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 namespace Monitor_Control
17 Constraint_Interpreter::Constraint_Interpreter ()
21 Constraint_Interpreter::~Constraint_Interpreter ()
26 Constraint_Interpreter::build_tree (const char *constraints
)
28 if (ETCL_Interpreter::is_empty_string (constraints
))
30 /// Root is deleted in the interpreter's destructor.
31 ACE_NEW_RETURN (this->root_
,
32 ETCL_Literal_Constraint (true),
37 /// root_ is set in this base class call.
38 if (ETCL_Interpreter::build_tree (constraints
) != 0)
40 ACELIB_ERROR_RETURN ((LM_ERROR
,
41 "Constraint_Interpreter::build_tree() - "
42 "ETCL_Interpreter::build_tree() failed\n"),
51 Constraint_Interpreter::evaluate (Constraint_Visitor
&evaluator
)
53 return evaluator
.evaluate_constraint (this->root_
);
58 ACE_END_VERSIONED_NAMESPACE_DECL
60 #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */