PG_Group_Guard.cpp

Go to the documentation of this file.
00001 #include "orbsvcs/PortableGroup/PG_Group_Guard.h"
00002 
00003 #include "orbsvcs/PortableGroup/PG_GenericFactory.h"
00004 #include "orbsvcs/PortableGroup/PG_ObjectGroupManager.h"
00005 
00006 
00007 ACE_RCSID (PortableGroup,
00008            PG_Group_Guard,
00009            "$Id: PG_Group_Guard.cpp 76626 2007-01-26 13:50:03Z elliott_c $")
00010 
00011 
00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00013 
00014 TAO_PG_Group_Guard::TAO_PG_Group_Guard (
00015   TAO_PG_GenericFactory & generic_factory,
00016   TAO_PG_Factory_Set & factory_set,
00017   TAO_PG_ObjectGroupManager & group_manager,
00018   const PortableServer::ObjectId & oid)
00019   : generic_factory_ (generic_factory),
00020     factory_set_ (factory_set),
00021     group_manager_ (group_manager),
00022     oid_ (oid),
00023     released_ (0)
00024 {
00025 }
00026 
00027 TAO_PG_Group_Guard::~TAO_PG_Group_Guard (void)
00028 {
00029   if (!this->released_)
00030     {
00031       try
00032         {
00033           this->generic_factory_.delete_object_i (this->factory_set_,
00034                                                   1  // Ignore exceptions
00035                                                   );
00036 
00037           // This should never throw an exception if this Guard is
00038           // used properly.
00039           this->group_manager_.destroy_object_group (this->oid_);
00040         }
00041       catch (const CORBA::Exception&)
00042         {
00043           // Ignore all exceptions.
00044         }
00045     }
00046 }
00047 
00048 void
00049 TAO_PG_Group_Guard::release (void)
00050 {
00051   this->released_ = 1;
00052 }
00053 
00054 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Sun Jan 27 16:22:30 2008 for TAO_PortableGroup by doxygen 1.3.6