#include <Topology_Object.h>
Inheritance diagram for TAO_Notify::Topology_Object:
Public Member Functions | |
Topology_Object () | |
The constructor. | |
virtual | ~Topology_Object () |
The destructor. | |
virtual void | initialize (Topology_Parent *topology_parent) |
Init this object with data from . | |
virtual Topology_Object * | load_child (const ACE_CString &, CORBA::Long, const NVPList &) |
Create a child of the appropriate type and return it. | |
virtual TAO_Notify_Object::ID | get_id () const |
Find the id associated with topology object. | |
void | get_id_path (IdVec &id_path) const |
Get the path of id's from the root to this object. | |
bool | is_changed () const |
Is there an unsaved change for this object or its children? | |
Protected Member Functions | |
virtual bool | is_persistent () const |
Should this object be saved? | |
bool | self_change (void) |
Method to report change in this object. | |
Topology_Parent * | topology_parent () const |
pointer to our topological parent | |
bool | send_change (void) |
Handle details of propagating change. | |
bool | send_deletion_change () |
Handle details of propagating change for a deleted object. | |
Protected Attributes | |
bool | self_changed_ |
true if this object changed since last save_persistent | |
bool | children_changed_ |
true of any of this object's children changed since last save_persistent | |
Topology_Parent * | topology_parent_ |
A safely-typed copy of parent_;. | |
Private Member Functions | |
virtual bool | change_to_parent (void) |
Send change to parent. |
Topology objects must be derived from this class to allow themselves to be persisted. Note: virtual inheritance from TopologySavable is unnecessary, but HP ACC compiler warns if it's not there.
Definition at line 107 of file Topology_Object.h.
|
The constructor.
Definition at line 29 of file Topology_Object.cpp.
00030 : TAO_Notify_Object () 00031 , Topology_Savable () 00032 , self_changed_ (false) 00033 , children_changed_ (false) 00034 , topology_parent_ (0) 00035 { 00036 } |
|
The destructor.
Definition at line 38 of file Topology_Object.cpp.
00039 { 00040 } |
|
Send change to parent. Override this if you don't expect to have a parent (top level of tree) private virtual because this should only be called from send_change()
Reimplemented in TAO_Notify_EventChannelFactory. Definition at line 125 of file Topology_Object.cpp. References TAO_Notify::Topology_Parent::child_change(), and topology_parent(). Referenced by send_change(), and send_deletion_change().
00126 { 00127 bool result = false; 00128 Topology_Parent * parent = this->topology_parent(); 00129 if (parent != 0) 00130 { 00131 result = parent->child_change(); 00132 } 00133 return result; 00134 } |
|
Find the id associated with topology object. A bit of a hack because id is unknown to Topology_Object the get_id returns the same thing as id -- we just need someone to find it for us. Reimplemented in TAO_Notify_EventChannel, and TAO_Notify_EventChannelFactory. Definition at line 147 of file Topology_Object.cpp. References ACE_ASSERT.
00148 { 00149 // If this assert triggers then implement the 00150 // get_id method in the actual class 00151 // derived from Topology_Object 00152 // or else figure out why this method was called 00153 // on an object that doesn't have an id. 00154 ACE_ASSERT (false); 00155 // if it is called in a release build, provide 'em a value 00156 return -1; 00157 } |
|
Get the path of id's from the root to this object.
Definition at line 137 of file Topology_Object.cpp. References TAO_Notify::IdVec, ACE_Vector< T, DEFAULT_SIZE >::push_back(), and topology_parent().
00138 { 00139 if (this->topology_parent() != 0) 00140 { 00141 this->topology_parent()->get_id_path (id_path); 00142 } 00143 id_path.push_back (this->get_id ()); 00144 } |
|
Init this object with data from .
Definition at line 43 of file Topology_Object.cpp. References ACE_ASSERT, TAO_Notify_Object::initialize(), and topology_parent_. Referenced by TAO_Notify_ProxySupplier::init(), TAO_Notify_ProxyConsumer::init(), TAO_Notify_EventChannel::init(), and TAO_Notify_Admin::init().
00044 { 00045 ACE_ASSERT (topology_parent != 0 && this->topology_parent_ == 0); 00046 this->topology_parent_ = topology_parent; 00047 TAO_Notify_Object::initialize (topology_parent); 00048 } |
|
Is there an unsaved change for this object or its children?
Definition at line 11 of file Topology_Object.inl. References children_changed_, and self_changed_. Referenced by TAO_Notify_Proxy::save_persistent(), TAO_Notify_EventChannelFactory::save_persistent(), and TAO_Notify_Admin::save_persistent().
00012 { 00013 return this->self_changed_ | this->children_changed_; 00014 } |
|
Should this object be saved? This is a way for send_change() and save_persistent() to find out if this object has a persistent QoS connection property.
Reimplemented in TAO_Notify_EventChannelFactory. Definition at line 66 of file Topology_Object.cpp. References TAO_Notify_QoSProperties::event_reliability(), TAO_Notify_PropertyBase_T< TYPE >::is_valid(), topology_parent(), and TAO_Notify_PropertyBase_T< TYPE >::value(). Referenced by TAO_Notify_Proxy::save_persistent(), TAO_Notify_EventChannel::save_persistent(), TAO_Notify_Admin::save_persistent(), send_change(), and send_deletion_change().
00067 { 00068 bool result = false; 00069 if (this->qos_properties_.event_reliability().is_valid ()) 00070 { 00071 result = CosNotification::Persistent == this->qos_properties_.event_reliability().value (); 00072 } 00073 else if (this->topology_parent () != 0) 00074 { 00075 result = this->topology_parent ()->is_persistent (); 00076 } 00077 return result; 00078 } |
|
Create a child of the appropriate type and return it. Use "type" as passed in to determine what kind of child (supporting the Topology_Object interface) to create and return. Inform it of its new ID. Reimplemented in TAO_Notify::Reconnection_Registry. Definition at line 58 of file Topology_Object.cpp.
00061 {
00062 return 0;
00063 }
|
|
|
Handle details of propagating change.
Definition at line 88 of file Topology_Object.cpp. References change_to_parent(), children_changed_, is_persistent(), and self_changed_. Referenced by TAO_Notify::Topology_Parent::child_change(), and self_change().
00089 { 00090 bool saving = false; 00091 if (is_persistent ()) 00092 { 00093 while (this->self_changed_ || this->children_changed_) 00094 { 00095 saving = this->change_to_parent (); 00096 if (!saving) 00097 { 00098 this->self_changed_ = false; 00099 this->children_changed_ = false; 00100 } 00101 } 00102 } 00103 else 00104 { 00105 this->self_changed_ = false; 00106 this->children_changed_ = false; 00107 } 00108 return saving; 00109 } |
|
Handle details of propagating change for a deleted object.
Definition at line 112 of file Topology_Object.cpp. References change_to_parent(), children_changed_, is_persistent(), and self_changed_. Referenced by TAO_Notify_StructuredProxyPushConsumer::disconnect_structured_push_consumer(), and TAO_Notify_StructuredProxyPushSupplier::disconnect_structured_push_supplier().
00113 { 00114 bool saving = false; 00115 if (is_persistent ()) 00116 { 00117 saving = this->change_to_parent (); 00118 } 00119 this->self_changed_ = false; 00120 this->children_changed_ = false; 00121 return saving; 00122 } |
|
pointer to our topological parent
Definition at line 51 of file Topology_Object.cpp. References topology_parent_. Referenced by change_to_parent(), get_id_path(), and is_persistent().
00052 { 00053 return this->topology_parent_; 00054 } |
|
true of any of this object's children changed since last save_persistent
Definition at line 186 of file Topology_Object.h. Referenced by is_changed(), send_change(), and send_deletion_change(). |
|
true if this object changed since last save_persistent
Definition at line 184 of file Topology_Object.h. Referenced by is_changed(), self_change(), send_change(), and send_deletion_change(). |
|
A safely-typed copy of parent_;.
Definition at line 189 of file Topology_Object.h. Referenced by initialize(), and topology_parent(). |