Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ace / Monitor_Control / Constraint_Interpreter.cpp
blob7cd1922fd3a3e6ce93cc6c1d5d3929fe0f9cf08b
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
13 namespace ACE
15 namespace Monitor_Control
17 Constraint_Interpreter::Constraint_Interpreter ()
21 Constraint_Interpreter::~Constraint_Interpreter ()
25 int
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),
33 -1);
35 else
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"),
43 -1);
47 return 0;
50 ACE_CDR::Boolean
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 */