00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef NOTIFY_CONSTRAINT_VISITORS_H
00016 #define NOTIFY_CONSTRAINT_VISITORS_H
00017
00018 #include "ace/pre.h"
00019 #include "ace/Hash_Map_Manager.h"
00020 #include "ace/Unbounded_Queue.h"
00021 #include "ace/Null_Mutex.h"
00022
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif
00026
00027 #include "orbsvcs/ETCL/ETCL_Constraint_Visitor.h"
00028 #include "orbsvcs/ETCL/ETCL_Constraint.h"
00029 #include "orbsvcs/CosNotificationC.h"
00030
00031 #include "orbsvcs/Notify/notify_serv_export.h"
00032
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034
00035 class TAO_Notify_Property_Constraint;
00036
00037 class TAO_Notify_Serv_Export TAO_Notify_Constraint_Visitor
00038 : public TAO_ETCL_Constraint_Visitor
00039 {
00040 public:
00041
00042 TAO_Notify_Constraint_Visitor (void);
00043
00044
00045 int bind_structured_event (const CosNotification::StructuredEvent &s_event);
00046
00047
00048
00049
00050
00051
00052
00053 CORBA::Boolean evaluate_constraint (TAO_ETCL_Constraint *root);
00054
00055
00056 int visit_literal (TAO_ETCL_Literal_Constraint *);
00057 int visit_identifier (TAO_ETCL_Identifier *);
00058 int visit_union_value (TAO_ETCL_Union_Value *);
00059 int visit_union_pos (TAO_ETCL_Union_Pos *);
00060 int visit_component_pos (TAO_ETCL_Component_Pos *);
00061 int visit_component_assoc (TAO_ETCL_Component_Assoc *);
00062 int visit_component_array (TAO_ETCL_Component_Array *);
00063 int visit_special (TAO_ETCL_Special *);
00064 int visit_component (TAO_ETCL_Component *);
00065 int visit_dot (TAO_ETCL_Dot *);
00066 int visit_eval (TAO_ETCL_Eval *);
00067 int visit_default (TAO_ETCL_Default *);
00068 int visit_exist (TAO_ETCL_Exist *);
00069 int visit_unary_expr (TAO_ETCL_Unary_Expr *);
00070 int visit_binary_expr (TAO_ETCL_Binary_Expr *);
00071 int visit_preference (TAO_ETCL_Preference *);
00072
00073 protected:
00074
00075 int visit_or (TAO_ETCL_Binary_Expr *);
00076 int visit_and (TAO_ETCL_Binary_Expr *);
00077 int visit_twiddle (TAO_ETCL_Binary_Expr *);
00078 int visit_in (TAO_ETCL_Binary_Expr *);
00079 int visit_binary_op (TAO_ETCL_Binary_Expr *binary_expr,
00080 int op_type);
00081
00082
00083 CORBA::Boolean sequence_does_contain (const CORBA::Any *any,
00084 TAO_ETCL_Literal_Constraint &item);
00085 CORBA::Boolean array_does_contain (const CORBA::Any *any,
00086 TAO_ETCL_Literal_Constraint &item);
00087 CORBA::Boolean struct_does_contain (const CORBA::Any *any,
00088 TAO_ETCL_Literal_Constraint &item);
00089 CORBA::Boolean union_does_contain (const CORBA::Any *any,
00090 TAO_ETCL_Literal_Constraint &item);
00091 CORBA::Boolean any_does_contain (const CORBA::Any *any,
00092 TAO_ETCL_Literal_Constraint &item);
00093
00094
00095
00096 CORBA::Boolean simple_type_match (int expr_type,
00097 CORBA::TCKind tc_kind);
00098
00099 enum structured_event_field
00100 {
00101 FILTERABLE_DATA,
00102 HEADER,
00103 FIXED_HEADER,
00104 EVENT_TYPE,
00105 DOMAIN_NAME,
00106 TYPE_NAME,
00107 EVENT_NAME,
00108 VARIABLE_HEADER,
00109 REMAINDER_OF_BODY,
00110 EMPTY
00111 };
00112
00113
00114 structured_event_field implicit_id_;
00115
00116
00117
00118
00119
00120
00121 static const size_t implicit_ids_size_;
00122
00123
00124
00125 ACE_Hash_Map_Manager <ACE_CString, structured_event_field, ACE_Null_Mutex>
00126 implicit_ids_;
00127
00128
00129
00130 static const size_t filterable_data_size_;
00131
00132
00133 ACE_Hash_Map_Manager <ACE_CString, CORBA::Any, ACE_Null_Mutex>
00134 filterable_data_;
00135
00136
00137
00138 static const size_t variable_header_size_;
00139
00140
00141 ACE_Hash_Map_Manager <ACE_CString, CORBA::Any, ACE_Null_Mutex>
00142 variable_header_;
00143
00144
00145
00146 CORBA::String_var domain_name_;
00147 CORBA::String_var type_name_;
00148 CORBA::String_var event_name_;
00149
00150
00151 CORBA::Any remainder_of_body_;
00152
00153
00154 ACE_Unbounded_Queue <TAO_ETCL_Literal_Constraint> queue_;
00155
00156
00157
00158 CORBA::Any_var current_value_;
00159
00160
00161
00162 CORBA::String_var current_name_;
00163 };
00164
00165 TAO_END_VERSIONED_NAMESPACE_DECL
00166
00167 #include "ace/post.h"
00168 #endif