summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Notify_Filter_i.h
blob: 61397f2fec7efd22f27e5fe5f359334798476c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// $Id$
// ==========================================================================
//
// = LIBRARY
//   orbsvcs
//
// = FILENAME
//   Notify_Filter_i.h
//
// = DESCRIPTION
//
//
// = AUTHOR
//    Pradeep Gore <pradeep@cs.wustl.edu>
//
// ==========================================================================

#ifndef TAO_NOTIFY_FILTER_I_H
#define TAO_NOTIFY_FILTER_I_H
#include "ace/pre.h"

#include "Notify_Constraint_Interpreter.h"
#include "Notify_ID_Pool_T.h"
#include "orbsvcs/CosNotifyFilterS.h"
#include "ace/Containers_T.h"
#include "ace/Hash_Map_Manager.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#if defined(_MSC_VER)
#if (_MSC_VER >= 1200)
#pragma warning(push)
#endif /* _MSC_VER >= 1200 */
#pragma warning(disable:4250)
#endif /* _MSC_VER */

class TAO_Notify_Export TAO_Notify_Filter_i : public POA_CosNotifyFilter::Filter,
  public PortableServer::RefCountServantBase
{
  // = TITLE
  //   TAO_Notify_Filter_i
  // = DESCRIPTION
  //
  //

public:
  //Constructor
  TAO_Notify_Filter_i (void);

  //Destructor
  virtual ~TAO_Notify_Filter_i (void);

  CosNotifyFilter::Filter_ptr
  get_ref (CORBA::Environment &ACE_TRY_ENV);
  // Activate with the default POA

virtual char * constraint_grammar (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ));

virtual CosNotifyFilter::ConstraintInfoSeq * add_constraints (
    const CosNotifyFilter::ConstraintExpSeq & constraint_list,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNotifyFilter::InvalidConstraint
  ));

virtual void modify_constraints (
    const CosNotifyFilter::ConstraintIDSeq & del_list,
    const CosNotifyFilter::ConstraintInfoSeq & modify_list,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNotifyFilter::InvalidConstraint,
    CosNotifyFilter::ConstraintNotFound
  ));

virtual CosNotifyFilter::ConstraintInfoSeq * get_constraints (
    const CosNotifyFilter::ConstraintIDSeq & id_list,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNotifyFilter::ConstraintNotFound
  ));

virtual CosNotifyFilter::ConstraintInfoSeq * get_all_constraints (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ));

virtual void remove_all_constraints (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ));

virtual void destroy (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ));

virtual CORBA::Boolean match (
    const CORBA::Any & filterable_data,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNotifyFilter::UnsupportedFilterableData
  ));

virtual CORBA::Boolean match_structured (
    const CosNotification::StructuredEvent & filterable_data,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNotifyFilter::UnsupportedFilterableData
  ));

virtual CORBA::Boolean match_typed (
    const CosNotification::PropertySeq & filterable_data,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNotifyFilter::UnsupportedFilterableData
  ));

virtual CosNotifyFilter::CallbackID attach_callback (
    CosNotifyComm::NotifySubscribe_ptr callback,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ));

virtual void detach_callback (
    CosNotifyFilter::CallbackID callback,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNotifyFilter::CallbackNotFound
  ));

virtual CosNotifyFilter::CallbackIDSeq * get_callbacks (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ));


private:
  void add_constraints_i (
    const CosNotifyFilter::ConstraintInfoSeq& constraint_info_seq,
    CORBA::Environment &ACE_TRY_ENV
  )
    ACE_THROW_SPEC ((
                     CORBA::SystemException,
                     CosNotifyFilter::InvalidConstraint
                     ));


    struct Notify_Constraint_Expr
    {
      // = DESCRIPTION
      //   Structure for associating ConstraintInfo with an interpreter.
      //
      CosNotifyFilter::ConstraintExp constr_expr;
      // Constraint Expression.

      TAO_Notify_Constraint_Interpreter interpreter;
      // Constraint Interpreter.
    };

  TAO_Notify_ID_Pool<CosNotifyFilter::ConstraintID> constraint_expr_ids_;
  // Id generator for ConstraintInfo's.

  ACE_Hash_Map_Manager <CosNotifyFilter::ConstraintID,
                        ACE_NESTED_CLASS (TAO_Notify_Filter_i, Notify_Constraint_Expr*),
                        ACE_SYNCH_MUTEX>
  constraint_expr_list_;
  // A list of the constraints stored in this filter.

  typedef ACE_Hash_Map_Iterator <CosNotifyFilter::ConstraintID,
                                 ACE_NESTED_CLASS (TAO_Notify_Filter_i, Notify_Constraint_Expr*),
                                                  ACE_SYNCH_MUTEX>
  CONSTRAINT_EXPR_LIST_ITER;

  typedef ACE_Hash_Map_Entry<CosNotifyFilter::ConstraintID,
                             ACE_NESTED_CLASS (TAO_Notify_Filter_i, Notify_Constraint_Expr*)>
  CONSTRAINT_EXPR_ENTRY;
};

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#pragma warning(pop)
#endif /* _MSC_VER */

#include "ace/post.h"
#endif /* TAO_NOTIFY_FILTER_I_H */