Guard implementation used to make object group cleanup exception-safe. More...
#include <PG_Group_Guard.h>
Public Member Functions | |
TAO_PG_Group_Guard (TAO_PG_GenericFactory &generic_factory, TAO_PG_Factory_Set &factory_set, TAO_PG_ObjectGroupManager &group_manager, const PortableServer::ObjectId &oid) | |
Constructor. | |
~TAO_PG_Group_Guard (void) | |
Destructor. | |
void | release (void) |
Relinquish cleanup responsibility. | |
Private Attributes | |
TAO_PG_GenericFactory & | generic_factory_ |
TAO_PG_Factory_Set & | factory_set_ |
TAO_PG_ObjectGroupManager & | group_manager_ |
const PortableServer::ObjectId & | oid_ |
bool | released_ |
Guard implementation used to make object group cleanup exception-safe.
This guard's destructor performs cleanup of object group resources. Thus, cleanup is performed when this guard goes out of scope unless explicitly released from that responsibility.
This guard is meant to be used internally by the TAO_PG_GenericFactory class.
Definition at line 48 of file PG_Group_Guard.h.
TAO_PG_Group_Guard::TAO_PG_Group_Guard | ( | TAO_PG_GenericFactory & | generic_factory, | |
TAO_PG_Factory_Set & | factory_set, | |||
TAO_PG_ObjectGroupManager & | group_manager, | |||
const PortableServer::ObjectId & | oid | |||
) |
Constructor.
Definition at line 14 of file PG_Group_Guard.cpp.
: generic_factory_ (generic_factory), factory_set_ (factory_set), group_manager_ (group_manager), oid_ (oid), released_ (false) { }
TAO_PG_Group_Guard::~TAO_PG_Group_Guard | ( | void | ) |
Destructor.
Definition at line 27 of file PG_Group_Guard.cpp.
{ if (!this->released_) { try { this->generic_factory_.delete_object_i (this->factory_set_, 1 // Ignore exceptions ); // This should never throw an exception if this Guard is // used properly. this->group_manager_.destroy_object_group (this->oid_); } catch (const CORBA::Exception&) { // Ignore all exceptions. } } }
void TAO_PG_Group_Guard::release | ( | void | ) |
Relinquish cleanup responsibility.
Definition at line 49 of file PG_Group_Guard.cpp.
{ this->released_ = true; }
Reference to the TAO_PG_Factory_Set that contains all application-specific GenericFactory object references.
Definition at line 72 of file PG_Group_Guard.h.
Reference to the infrastructure TAO_PG_GenericFactory that created the below TAO_PG_Factory_Set.
Definition at line 68 of file PG_Group_Guard.h.
Reference to the TAO_PG_ObjectGroupManager that maintains the object group map.
Definition at line 76 of file PG_Group_Guard.h.
const PortableServer::ObjectId& TAO_PG_Group_Guard::oid_ [private] |
Reference to the ObjectId that is the map key necessary to unbind the corresponding object group map entry from the map upon destruction.
Definition at line 81 of file PG_Group_Guard.h.
bool TAO_PG_Group_Guard::released_ [private] |
Flag that dictates whether or not the destructor will perform cleanup.
Definition at line 85 of file PG_Group_Guard.h.