00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Constraint_Visitor.h 00006 * 00007 * $Id: Constraint_Visitor.h 86518 2009-08-18 12:30:56Z olli $ 00008 * 00009 * @author Jeff Parsons <j.parsons@vanderbilt.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef CONSTRAINT_VISITOR_H 00014 #define CONSTRAINT_VISITOR_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "ace/CDR_Base.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 #pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1) 00025 00026 #include "ace/Monitor_Control_Types.h" 00027 00028 #include "ace/ETCL/ETCL_Constraint.h" 00029 #include "ace/ETCL/ETCL_Constraint_Visitor.h" 00030 00031 #include "ace/Monitor_Control/Monitor_Control_export.h" 00032 00033 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class ETCL_Literal_Constraint; 00036 class ETCL_Identifier; 00037 class ETCL_Unary_Expr; 00038 class ETCL_Binary_Expr; 00039 class ETCL_Constraint; 00040 00041 namespace ACE 00042 { 00043 namespace Monitor_Control 00044 { 00045 /** 00046 * @class Constraint_Visitor 00047 * 00048 * @brief Backend for the non-CORBA ETCL frontend, specific to 00049 * MonitorControl and supporting only basic types not 00050 specific to CORBA. 00051 */ 00052 class MONITOR_CONTROL_Export Constraint_Visitor 00053 : public ETCL_Constraint_Visitor 00054 { 00055 public: 00056 Constraint_Visitor (const Monitor_Control_Types::Data& data); 00057 virtual ~Constraint_Visitor (void); 00058 00059 ACE_CDR::Boolean evaluate_constraint (ETCL_Constraint *root); 00060 00061 virtual int visit_literal (ETCL_Literal_Constraint *); 00062 virtual int visit_identifier (ETCL_Identifier *); 00063 virtual int visit_unary_expr (ETCL_Unary_Expr *); 00064 virtual int visit_binary_expr (ETCL_Binary_Expr *); 00065 00066 private: 00067 /// Sub-methods for visit_binary_expr(). 00068 int visit_or (ETCL_Binary_Expr *); 00069 int visit_and (ETCL_Binary_Expr *); 00070 int visit_binary_op (ETCL_Binary_Expr *binary_expr, 00071 int op_type); 00072 00073 private: 00074 const Monitor_Control_Types::Data& data_; 00075 ACE_Unbounded_Queue<ETCL_Literal_Constraint> queue_; 00076 }; 00077 } 00078 } 00079 00080 ACE_END_VERSIONED_NAMESPACE_DECL 00081 00082 #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */ 00083 00084 #include /**/ "ace/post.h" 00085 00086 #endif // CONSTRAINT_VISITOR_H