00001 // -*- C++ -*- 00002 //============================================================================= 00003 /** 00004 * @file FilterAdmin.h 00005 * 00006 * $Id: FilterAdmin.h 77001 2007-02-12 07:54:49Z johnnyw $ 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 00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00029 00030 /** 00031 * @class TAO_Notify_FilterAdmin 00032 * 00033 * @brief FilterAdmin interface methods implementation. 00034 * 00035 */ 00036 class TAO_Notify_Serv_Export TAO_Notify_FilterAdmin 00037 : public TAO_Notify::Topology_Object 00038 { 00039 00040 public: 00041 /// Constructor 00042 TAO_Notify_FilterAdmin (void); 00043 00044 /// Destructor 00045 virtual ~TAO_Notify_FilterAdmin (void); 00046 00047 // = match operation on all the filters 00048 /// See if any of the filters match. 00049 CORBA::Boolean match (const TAO_Notify_Event::Ptr &event); 00050 00051 // = match operation on all the filters 00052 /// See if any of the filters match. 00053 CORBA::Boolean match (const TAO_Notify_Event* event); 00054 00055 virtual CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr new_filter); 00056 00057 virtual void remove_filter (CosNotifyFilter::FilterID filter); 00058 00059 virtual CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID filter); 00060 00061 virtual CosNotifyFilter::FilterIDSeq * get_all_filters (void); 00062 00063 virtual void remove_all_filters (void); 00064 00065 00066 // TAO_Notify::Topology_Object 00067 00068 virtual void save_persistent (TAO_Notify::Topology_Saver& saver); 00069 virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, CORBA::Long id, 00070 const TAO_Notify::NVPList& attrs); 00071 private: 00072 typedef ACE_Hash_Map_Manager <CosNotifyFilter::FilterID, CosNotifyFilter::Filter_var, ACE_SYNCH_NULL_MUTEX> FILTER_LIST; 00073 00074 virtual void release (void); 00075 00076 /// Mutex to serialize access to data members. 00077 TAO_SYNCH_MUTEX lock_; 00078 00079 /// List of filters 00080 FILTER_LIST filter_list_; 00081 00082 /// Id generator for proxy suppliers 00083 TAO_Notify_ID_Factory filter_ids_; 00084 }; 00085 00086 TAO_END_VERSIONED_NAMESPACE_DECL 00087 00088 #if defined (__ACE_INLINE__) 00089 #include "orbsvcs/Notify/FilterAdmin.inl" 00090 #endif /* __ACE_INLINE__ */ 00091 00092 #include /**/ "ace/post.h" 00093 00094 #endif /* NOTIFY_FILTERADMIN_H */