summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h
blob: 45114b2879f2dd53af46accc0a029a77e827b144 (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
// -*- C++ -*-
//=============================================================================
/**
 *  @file   FilterAdmin.h
 *
 *  $Id$
 *
 *  @author Pradeep Gore <pradeep@cs.wustl.edu>
 */
//=============================================================================


#ifndef NOTIFY_FILTERADMIN_H

#define NOTIFY_FILTERADMIN_H

#include /**/ "ace/pre.h"

#include "orbsvcs/CosNotifyFilterS.h"

#include "ace/Hash_Map_Manager.h"

#include "orbsvcs/Notify/ID_Factory.h"
#include "orbsvcs/Notify/Event.h"
#include "orbsvcs/Notify/notify_serv_export.h"
#include "orbsvcs/Notify/Topology_Object.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/**
 * @class TAO_Notify_FilterAdmin
 *
 * @brief FilterAdmin interface methods implementation.
 *
 */
class TAO_Notify_Serv_Export TAO_Notify_FilterAdmin
  : public TAO_Notify::Topology_Object
{

 public:
  /// Constructor
  TAO_Notify_FilterAdmin (void);

  /// Destructor
  virtual ~TAO_Notify_FilterAdmin (void);

  // = match operation on all the filters
  /// See if any of the filters match.
  CORBA::Boolean match (const TAO_Notify_Event::Ptr &event);

  // = match operation on all the filters
  /// See if any of the filters match.
  CORBA::Boolean match (const TAO_Notify_Event* event);

  virtual CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr new_filter);

  virtual void remove_filter (CosNotifyFilter::FilterID filter);

  virtual CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID filter);

  virtual CosNotifyFilter::FilterIDSeq * get_all_filters (void);

  virtual void remove_all_filters (void);


  // TAO_Notify::Topology_Object

  virtual void save_persistent (TAO_Notify::Topology_Saver& saver);
  virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, CORBA::Long id,
    const TAO_Notify::NVPList& attrs);
 private:
  typedef ACE_Hash_Map_Manager <CosNotifyFilter::FilterID, CosNotifyFilter::Filter_var, ACE_SYNCH_NULL_MUTEX> FILTER_LIST;

  virtual void release (void);

  /// Mutex to serialize access to data members.
  TAO_SYNCH_MUTEX lock_;

  /// List of filters
  FILTER_LIST filter_list_;

  /// Id generator for proxy suppliers
  TAO_Notify_ID_Factory filter_ids_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined (__ACE_INLINE__)
#include "orbsvcs/Notify/FilterAdmin.inl"
#endif /* __ACE_INLINE__ */

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

#endif /* NOTIFY_FILTERADMIN_H */