summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp
new file mode 100644
index 00000000000..01a08c99064
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp
@@ -0,0 +1,45 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Constraint_Interpreter.h"
+#include "orbsvcs/Notify/Notify_Constraint_Visitors.h"
+
+ACE_RCSID(Notify, NS_Constraint_Interpreter, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Constraint_Interpreter::TAO_Notify_Constraint_Interpreter (void)
+{
+}
+
+TAO_Notify_Constraint_Interpreter::~TAO_Notify_Constraint_Interpreter (void)
+{
+}
+
+void
+TAO_Notify_Constraint_Interpreter::build_tree (
+ const char *constraints
+ )
+{
+ if (TAO_ETCL_Interpreter::is_empty_string (constraints))
+ {
+ // Root is deleted in the TAO_Interpreter's destructor.
+ ACE_NEW_THROW_EX (this->root_,
+ TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1),
+ CORBA::NO_MEMORY ());
+ }
+ else
+ {
+ // root_ is set in this base class call.
+ if (TAO_ETCL_Interpreter::build_tree (constraints) != 0)
+ throw CosNotifyFilter::InvalidConstraint ();
+ }
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Interpreter::evaluate (TAO_Notify_Constraint_Visitor &evaluator)
+{
+ return evaluator.evaluate_constraint (this->root_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL