Base class for Persistent Topology Objects. More...
#include <Topology_Object.h>
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 <rhs>. | |
virtual Topology_Object * | load_child (const ACE_CString &type, CORBA::Long id, const NVPList &attrs) |
Create a child of the appropriate type and return it. | |
virtual TAO_Notify_Object::ID | get_id (void) 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 (void) const |
Is there an unsaved change for this object or its children? | |
Protected Member Functions | |
virtual bool | is_persistent (void) 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. |
Base class for Persistent Topology Objects.
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.
TAO_Notify::Topology_Object::Topology_Object | ( | ) |
The constructor.
Definition at line 29 of file Topology_Object.cpp.
: TAO_Notify_Object () , Topology_Savable () , self_changed_ (false) , children_changed_ (false) , topology_parent_ (0) { }
TAO_Notify::Topology_Object::~Topology_Object | ( | ) | [virtual] |
bool TAO_Notify::Topology_Object::change_to_parent | ( | void | ) | [private, virtual] |
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.
{ bool result = false; Topology_Parent * parent = this->topology_parent(); if (parent != 0) { result = parent->child_change(); } return result; }
TAO_Notify_Object::ID TAO_Notify::Topology_Object::get_id | ( | void | ) | const [virtual] |
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.
{ // If this assert triggers then implement the // get_id method in the actual class // derived from Topology_Object // or else figure out why this method was called // on an object that doesn't have an id. ACE_ASSERT (false); // if it is called in a release build, provide 'em a value return -1; }
void TAO_Notify::Topology_Object::get_id_path | ( | TAO_Notify::IdVec & | id_path | ) | const |
Get the path of id's from the root to this object.
Definition at line 137 of file Topology_Object.cpp.
{ if (this->topology_parent() != 0) { this->topology_parent()->get_id_path (id_path); } id_path.push_back (this->get_id ()); }
void TAO_Notify::Topology_Object::initialize | ( | Topology_Parent * | topology_parent | ) | [virtual] |
Init this object with data from <rhs>.
Definition at line 43 of file Topology_Object.cpp.
{ ACE_ASSERT (topology_parent != 0 && this->topology_parent_ == 0); this->topology_parent_ = topology_parent; TAO_Notify_Object::initialize (topology_parent); }
bool TAO_Notify::Topology_Object::is_changed | ( | void | ) | const |
Is there an unsaved change for this object or its children?
Definition at line 11 of file Topology_Object.inl.
{ return this->self_changed_ | this->children_changed_; }
bool TAO_Notify::Topology_Object::is_persistent | ( | void | ) | const [protected, virtual] |
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.
{ bool result = false; if (this->qos_properties_.event_reliability().is_valid ()) { result = CosNotification::Persistent == this->qos_properties_.event_reliability().value (); } else if (this->topology_parent () != 0) { result = this->topology_parent ()->is_persistent (); } return result; }
Topology_Object * TAO_Notify::Topology_Object::load_child | ( | const ACE_CString & | type, | |
CORBA::Long | id, | |||
const NVPList & | attrs | |||
) | [virtual] |
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_Admin, TAO_Notify_ConsumerAdmin, TAO_Notify_Constraint_Expr, TAO_Notify_ETCL_Filter, TAO_Notify_ETCL_FilterFactory, TAO_Notify_EventChannel, TAO_Notify_EventChannelFactory, TAO_Notify_EventTypeSeq, TAO_Notify_FilterAdmin, TAO_Notify_Proxy, TAO_Notify::Reconnection_Registry, and TAO_Notify_SupplierAdmin.
Definition at line 58 of file Topology_Object.cpp.
{
return 0;
}
bool TAO_Notify::Topology_Object::self_change | ( | void | ) | [protected] |
Method to report change in this object.
see also Topology_Parent::child_change ()
Definition at line 81 of file Topology_Object.cpp.
{ this->self_changed_ = true; return send_change (); }
bool TAO_Notify::Topology_Object::send_change | ( | void | ) | [protected] |
Handle details of propagating change.
Definition at line 88 of file Topology_Object.cpp.
{ bool saving = false; if (is_persistent ()) { while (this->self_changed_ || this->children_changed_) { saving = this->change_to_parent (); if (!saving) { this->self_changed_ = false; this->children_changed_ = false; } } } else { this->self_changed_ = false; this->children_changed_ = false; } return saving; }
bool TAO_Notify::Topology_Object::send_deletion_change | ( | void | ) | [protected] |
Handle details of propagating change for a deleted object.
Definition at line 112 of file Topology_Object.cpp.
{ bool saving = false; if (is_persistent ()) { saving = this->change_to_parent (); } this->self_changed_ = false; this->children_changed_ = false; return saving; }
Topology_Parent * TAO_Notify::Topology_Object::topology_parent | ( | ) | const [protected] |
pointer to our topological parent
Definition at line 51 of file Topology_Object.cpp.
{ return this->topology_parent_; }
bool TAO_Notify::Topology_Object::children_changed_ [protected] |
true of any of this object's children changed since last save_persistent
Definition at line 186 of file Topology_Object.h.
bool TAO_Notify::Topology_Object::self_changed_ [protected] |
true if this object changed since last save_persistent
Definition at line 184 of file Topology_Object.h.
A safely-typed copy of parent_;.
Definition at line 189 of file Topology_Object.h.