00001 // -*- C++ -*- 00002 //============================================================================= 00003 /** 00004 * @file FilterAdmin.h 00005 * 00006 * $Id: FilterAdmin.h 84728 2009-03-05 19:58:54Z dai_y $ 00007 * 00008 * @author Pradeep Gore <pradeep@cs.wustl.edu> 00009 */ 00010 //============================================================================= 00011 00012 00013 #ifndef NOTIFY_FILTERADMIN_H 00014 00015 #define NOTIFY_FILTERADMIN_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "orbsvcs/CosNotifyFilterS.h" 00020 00021 #include "ace/Hash_Map_Manager.h" 00022 00023 #include "orbsvcs/Notify/ID_Factory.h" 00024 #include "orbsvcs/Notify/Event.h" 00025 #include "orbsvcs/Notify/notify_serv_export.h" 00026 #include "orbsvcs/Notify/Topology_Object.h" 00027 #include "orbsvcs/Notify/EventChannel.h" 00028 00029 class TAO_Notify_EventChannel; 00030 00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00032 00033 /** 00034 * @class TAO_Notify_FilterAdmin 00035 * 00036 * @brief FilterAdmin interface methods implementation. 00037 * 00038 */ 00039 class TAO_Notify_Serv_Export TAO_Notify_FilterAdmin 00040 : public TAO_Notify::Topology_Object 00041 { 00042 00043 public: 00044 /// Constructor 00045 TAO_Notify_FilterAdmin (void); 00046 00047 /// Destructor 00048 virtual ~TAO_Notify_FilterAdmin (void); 00049 00050 // = match operation on all the filters 00051 /// See if any of the filters match. 00052 CORBA::Boolean match (const TAO_Notify_Event::Ptr &event); 00053 00054 // = match operation on all the filters 00055 /// See if any of the filters match. 00056 CORBA::Boolean match (const TAO_Notify_Event* event); 00057 00058 virtual CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr new_filter); 00059 00060 virtual void remove_filter (CosNotifyFilter::FilterID filter); 00061 00062 virtual CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID filter); 00063 00064 virtual CosNotifyFilter::FilterIDSeq * get_all_filters (void); 00065 00066 virtual void remove_all_filters (void); 00067 00068 00069 // TAO_Notify::Topology_Object 00070 00071 virtual void save_persistent (TAO_Notify::Topology_Saver& saver); 00072 virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, CORBA::Long id, 00073 const TAO_Notify::NVPList& attrs); 00074 00075 void event_channel (TAO_Notify_EventChannel* ec); 00076 00077 private: 00078 typedef ACE_Hash_Map_Manager <CosNotifyFilter::FilterID, CosNotifyFilter::Filter_var, ACE_SYNCH_NULL_MUTEX> FILTER_LIST; 00079 00080 virtual void release (void); 00081 00082 /// Mutex to serialize access to data members. 00083 TAO_SYNCH_MUTEX lock_; 00084 00085 /// List of filters 00086 FILTER_LIST filter_list_; 00087 00088 /// Id generator for proxy suppliers 00089 TAO_Notify_ID_Factory filter_ids_; 00090 00091 TAO_Notify_EventChannel::Ptr ec_; 00092 }; 00093 00094 TAO_END_VERSIONED_NAMESPACE_DECL 00095 00096 #if defined (__ACE_INLINE__) 00097 #include "orbsvcs/Notify/FilterAdmin.inl" 00098 #endif /* __ACE_INLINE__ */ 00099 00100 #include /**/ "ace/post.h" 00101 00102 #endif /* NOTIFY_FILTERADMIN_H */