#include <EventType.h>
Inheritance diagram for TAO_Notify_EventType:
Public Member Functions | |
TAO_Notify_EventType (void) | |
Constuctor. | |
TAO_Notify_EventType (const char *domain_name, const char *type_name) | |
TAO_Notify_EventType (const CosNotification::EventType &event_type) | |
virtual | ~TAO_Notify_EventType () |
Destructor. | |
u_long | hash (void) const |
hash value | |
TAO_Notify_EventType & | operator= (const CosNotification::EventType &event_type) |
Assignment from CosNotification::EventType. | |
TAO_Notify_EventType & | operator= (const TAO_Notify_EventType &event_type) |
Assignment operator. | |
bool | operator== (const TAO_Notify_EventType ¬ify_event_type) const |
== operator | |
bool | operator!= (const TAO_Notify_EventType ¬ify_event_type) const |
!= operator | |
CORBA::Boolean | is_special (void) const |
const CosNotification::EventType & | native (void) const |
void | dump (void) const |
Helper to print contents. | |
bool | init (const TAO_Notify::NVPList &attrs) |
Initialize from an NVPList, return false on failure. | |
virtual void | save_persistent (TAO_Notify::Topology_Saver &saver) |
Static Public Member Functions | |
TAO_Notify_EventType | special (void) |
Protected Member Functions | |
void | init_i (const char *domain_name, const char *type_name) |
Init this object. | |
void | recompute_hash (void) |
bool | domain_is_wildcard (const char *domain) const |
bool | type_is_wildcard (const char *type) const |
Protected Attributes | |
CosNotification::EventType | event_type_ |
u_long | hash_value_ |
Definition at line 38 of file EventType.h.
|
Constuctor.
Definition at line 27 of file EventType.cpp. Referenced by special().
00028 { 00029 } |
|
Definition at line 46 of file EventType.cpp. References init_i().
00048 { 00049 this->init_i (domain_name, type_name); 00050 } |
|
Definition at line 52 of file EventType.cpp. References init_i().
00055 { 00056 this->init_i (event_type.domain_name.in (), event_type.type_name.in ()); 00057 } |
|
Destructor.
Definition at line 59 of file EventType.cpp.
00060 { 00061 } |
|
Definition at line 20 of file EventType.inl. References ACE_OS::strcmp(). Referenced by is_special(), and operator==().
00021 { 00022 return (domain == 0 || ACE_OS::strcmp (domain, "") == 0 || 00023 ACE_OS::strcmp (domain, "*") == 0); 00024 } |
|
Helper to print contents.
Definition at line 128 of file EventType.cpp. References ACE_DEBUG, and LM_DEBUG. Referenced by TAO_Notify_EventTypeSeq::dump().
00129 { 00130 ACE_DEBUG ((LM_DEBUG, 00131 "(%s,%s)", 00132 this->event_type_.domain_name.in (), 00133 this->event_type_.type_name.in ())); 00134 } |
|
hash value
Definition at line 8 of file EventType.inl.
00009 { 00010 return this->hash_value_; 00011 } |
|
Initialize from an NVPList, return false on failure.
Definition at line 137 of file EventType.cpp. References ACE_CString, init_i(), and TAO_Notify::NVPList::load(). Referenced by TAO_Notify_EventTypeSeq::load_child().
00138 { 00139 bool result = false; 00140 00141 ACE_CString domain; 00142 ACE_CString type; 00143 if (attrs.load("Domain", domain) && attrs.load("Type", type)) 00144 { 00145 this->init_i(domain.c_str(), type.c_str()); 00146 result = true; 00147 } 00148 return result; 00149 00150 } |
|
Init this object.
Definition at line 32 of file EventType.cpp. References is_special(), recompute_hash(), and CORBA::string_dup(). Referenced by init(), operator=(), and TAO_Notify_EventType().
00033 { 00034 this->event_type_.domain_name = domain_name; 00035 this->event_type_.type_name = type_name; 00036 00037 if (this->is_special () == 1) 00038 { 00039 this->event_type_.domain_name = CORBA::string_dup ("*"); 00040 this->event_type_.type_name = CORBA::string_dup ("%ALL"); 00041 } 00042 00043 this->recompute_hash (); 00044 } |
|
Definition at line 121 of file EventType.cpp. References domain_is_wildcard(), and type_is_wildcard(). Referenced by init_i(), TAO_Notify_Event_Map_T< PROXY, ACE_LOCK >::insert(), TAO_Notify_EventTypeSeq::populate_no_special(), and TAO_Notify_Event_Map_T< PROXY, ACE_LOCK >::remove().
00122 { 00123 return (this->domain_is_wildcard (this->event_type_.domain_name) && 00124 this->type_is_wildcard (this->event_type_.type_name)); 00125 } |
|
Definition at line 14 of file EventType.inl. Referenced by TAO_Notify_EventTypeSeq::populate(), and TAO_Notify_EventTypeSeq::populate_no_special().
00015 { 00016 return event_type_; 00017 } |
|
!= operator
Definition at line 115 of file EventType.cpp.
00116 { 00117 return !(*this == event_type); 00118 } |
|
Assignment operator.
Definition at line 91 of file EventType.cpp. References event_type_, and init_i().
00092 { 00093 if (this == &event_type) 00094 return *this; 00095 00096 this->init_i (event_type.event_type_.domain_name.in (),event_type.event_type_.type_name.in ()); 00097 00098 return *this; 00099 } |
|
Assignment from CosNotification::EventType.
Definition at line 83 of file EventType.cpp. References init_i().
00084 { 00085 this->init_i (event_type.domain_name.in (),event_type.type_name.in ()); 00086 00087 return *this; 00088 } |
|
== operator
Definition at line 102 of file EventType.cpp. References domain_is_wildcard(), event_type_, ACE_OS::strcmp(), and type_is_wildcard().
00103 { 00104 return (ACE_OS::strcmp (this->event_type_.domain_name, 00105 event_type.event_type_.domain_name) == 0 || 00106 this->domain_is_wildcard (this->event_type_.domain_name) || 00107 this->domain_is_wildcard (event_type.event_type_.type_name)) && 00108 (ACE_OS::strcmp (this->event_type_.type_name, 00109 event_type.event_type_.type_name) == 0 || 00110 this->type_is_wildcard (this->event_type_.type_name) || 00111 this->type_is_wildcard (event_type.event_type_.type_name)); 00112 } |
|
Definition at line 64 of file EventType.cpp. References ACE::hash_pjw(), ACE_OS::strcat(), and ACE_OS::strcpy(). Referenced by init_i().
00065 { 00066 // @@ Pradeep: this code is bound to crash someday if the strings 00067 // are too long.... See if the hash_pjw () function can be modified 00068 // to take accumulate multiple strings, as in: 00069 // hash = ACE::hash_pjw_accummulate (0, str1); 00070 // hash = ACE::hash_pjw_accummulate (hash, str2); 00071 // 00072 // @@ Or use grow the buffer when needed, or just add the two hash 00073 // values or something, but fix this code! 00074 // 00075 char buffer[BUFSIZ]; 00076 ACE_OS::strcpy (buffer, this->event_type_.domain_name.in ()); 00077 ACE_OS::strcat (buffer, this->event_type_.type_name.in ()); 00078 00079 this->hash_value_ = ACE::hash_pjw (buffer); 00080 } |
|
Save our state to a Topology_Saver. Use the methods of a Topology_Saver to store all information we want persisted. This function is called by our parent, which gives us a saver to use. In turn, we must call this function on all of our children. The implementation should look like: bool change = this->self_changed_; this->self_changed_ = false; this->children_changed_ = false; if (is_persistent ()) { bool want_all_children = saver.begin_object( this->id(), type, attrs, change); for all children { if (want_all_children || child.is_changed()) { child.save_persistent(saver); } } for all deleted children { saver.delete_child(child_type, child_id); } saver.end_object(this->id(), type); ) Implements TAO_Notify::Topology_Savable. Definition at line 155 of file EventType.cpp. References TAO_Notify::Topology_Saver::begin_object(), TAO_Notify::Topology_Saver::end_object(), and TAO_Notify::NVPList::push_back(). Referenced by TAO_Notify_EventTypeSeq::save_persistent().
00156 { 00157 TAO_Notify::NVPList attrs; 00158 bool changed = true; 00159 00160 attrs.push_back(TAO_Notify::NVP("Domain", this->event_type_.domain_name.in())); 00161 attrs.push_back(TAO_Notify::NVP("Type", this->event_type_.type_name.in())); 00162 saver.begin_object(0, "subscription", attrs, changed); 00163 00164 saver.end_object(0, "subscription"); 00165 } |
|
Definition at line 22 of file EventType.cpp. References TAO_Notify_EventType(). Referenced by TAO_Notify_EventTypeSeq::add_and_remove(), TAO_Notify_Peer::dispatch_updates(), TAO_Notify_EventTypeSeq::populate_no_special(), and TAO_Notify_Builder::TAO_Notify_Builder().
00023 { 00024 return TAO_Notify_EventType ("*", "%ALL"); 00025 } |
|
Definition at line 27 of file EventType.inl. References ACE_OS::strcmp(). Referenced by is_special(), and operator==().
00028 { 00029 return (type == 0 || ACE_OS::strcmp (type, "") == 0 || 00030 ACE_OS::strcmp (type, "*") == 0 || 00031 ACE_OS::strcmp (type, "%ALL") == 0); 00032 } |
|
Definition at line 95 of file EventType.h. Referenced by operator=(), and operator==(). |
|
Definition at line 98 of file EventType.h. |