#include <PG_Group_Factory.h>
Collaboration diagram for TAO::PG_Group_Factory:
Public Member Functions | |
PG_Group_Factory () | |
Constructor. | |
~PG_Group_Factory () | |
Destructor. | |
void | init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableGroup::FactoryRegistry_ptr factory_registry) |
TAO::PG_Object_Group * | create_group (const char *type_id, const PortableGroup::Criteria &the_criteria, TAO::PG_Property_Set *typeid_properties) |
void | delete_group (PortableGroup::ObjectGroup_ptr object_group) |
void | delete_group (PortableGroup::ObjectGroupId group_id) |
PortableGroup::ObjectGroups * | groups_at_location (const PortableGroup::Location &the_location) |
int | insert_group (::TAO::PG_Object_Group *group) |
int | insert_group (PortableGroup::ObjectGroupId group_id,::TAO::PG_Object_Group *group) |
int | find_group (PortableGroup::ObjectGroupId group_id,::TAO::PG_Object_Group *&group) const |
int | find_group (PortableGroup::ObjectGroup_ptr object_group,::TAO::PG_Object_Group *&group) const |
int | destroy_group (PortableGroup::ObjectGroupId object_group_id) |
int | destroy_group (PortableGroup::ObjectGroup_ptr object_group) |
Private Types | |
typedef ACE_Hash_Map_Manager_Ex< PortableGroup::ObjectGroupId, ::TAO::PG_Object_Group *, ACE_Hash< ACE_UINT64 >, ACE_Equal_To< ACE_UINT64 >, TAO_SYNCH_MUTEX > | Group_Map |
typedef ACE_Hash_Map_Entry< PortableGroup::ObjectGroupId, ::TAO::PG_Object_Group * > | Group_Map_Entry |
typedef ACE_Hash_Map_Iterator_Ex< PortableGroup::ObjectGroupId, ::TAO::PG_Object_Group *, ACE_Hash< ACE_UINT64 >, ACE_Equal_To< ACE_UINT64 >, TAO_SYNCH_MUTEX > | Group_Map_Iterator |
Private Attributes | |
CORBA::ORB_var | orb_ |
PortableServer::POA_var | poa_ |
Reference to the POA used to create object group references. | |
PortableGroup::FactoryRegistry_var | factory_registry_ |
The factory registry for replica factories. | |
::TAO::PG_Object_Group_Manipulator | manipulator_ |
const char * | domain_id_ |
Group_Map | group_map_ |
Definition at line 52 of file PG_Group_Factory.h.
|
Definition at line 61 of file PG_Group_Factory.h. |
|
Definition at line 63 of file PG_Group_Factory.h. |
|
Definition at line 70 of file PG_Group_Factory.h. Referenced by groups_at_location(), and ~PG_Group_Factory(). |
|
Constructor.
Definition at line 27 of file PG_Group_Factory.cpp.
00028 : orb_ (CORBA::ORB::_nil()) 00029 , poa_ (PortableServer::POA::_nil()) 00030 , manipulator_ () 00031 , domain_id_ ("default-domain") 00032 00033 { 00034 } |
|
Destructor.
Definition at line 36 of file PG_Group_Factory.cpp. References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), group_map_, Group_Map_Iterator, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all().
00037 { 00038 for (Group_Map_Iterator it = this->group_map_.begin (); 00039 it != this->group_map_.end (); 00040 ++it) 00041 { 00042 TAO::PG_Object_Group * group = (*it).int_id_; 00043 delete group; 00044 } 00045 this->group_map_.unbind_all (); 00046 } |
|
Definition at line 71 of file PG_Group_Factory.cpp. References ACE_NEW_THROW_EX, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), PortableGroup::Criteria, factory_registry_, TAO::PG_Utils::get_tagged_component(), group_map_, and manipulator_.
00075 { 00076 /////////////////////////////////// 00077 // Create an empty group reference 00078 00079 PortableGroup::ObjectGroupId group_id = 0; 00080 PortableGroup::ObjectGroup_var empty_group = 00081 this->manipulator_.create_object_group ( 00082 type_id, 00083 this->domain_id_, 00084 group_id); 00085 00086 // pick up the object group information as assigned by 00087 // ObjectGroupManager 00088 00089 PortableGroup::TagGroupTaggedComponent tagged_component; 00090 if (! TAO::PG_Utils::get_tagged_component (empty_group, tagged_component)) 00091 { 00092 throw PortableGroup::ObjectNotCreated(); 00093 } 00094 00095 TAO::PG_Object_Group * objectGroup = 0; 00096 00097 ACE_NEW_THROW_EX ( 00098 objectGroup, 00099 TAO::PG_Object_Group ( 00100 this->orb_.in (), 00101 this->factory_registry_.in (), 00102 this->manipulator_, 00103 empty_group.in (), 00104 tagged_component, 00105 type_id, 00106 the_criteria, 00107 typeid_properties 00108 ), 00109 CORBA::NO_MEMORY()); 00110 00111 if (this->group_map_.bind (group_id, objectGroup) != 0) 00112 { 00113 delete objectGroup; 00114 throw PortableGroup::ObjectNotCreated(); 00115 } 00116 return objectGroup; 00117 } |
|
Definition at line 128 of file PG_Group_Factory.cpp. References destroy_group().
00129 { 00130 if (! destroy_group (group_id)) 00131 { 00132 throw PortableGroup::ObjectNotFound (); 00133 } 00134 } |
|
Definition at line 119 of file PG_Group_Factory.cpp. References destroy_group().
00120 { 00121 if (! destroy_group (object_group)) 00122 { 00123 throw PortableGroup::ObjectNotFound (); 00124 } 00125 } |
|
remove group from map and delete it. note: uses group id extracted from object_group
Definition at line 174 of file PG_Group_Factory.cpp. References destroy_group(), and TAO::PG_Utils::get_tagged_component().
00175 { 00176 PortableGroup::TagGroupTaggedComponent tc; 00177 TAO::PG_Utils::get_tagged_component (object_group, tc); 00178 return destroy_group (tc.object_group_id); 00179 } |
|
remove group from map and delete it.
Definition at line 163 of file PG_Group_Factory.cpp. References group_map_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind(). Referenced by delete_group(), and destroy_group().
00164 { 00165 ::TAO::PG_Object_Group * group = 0; 00166 int result = (this->group_map_.unbind (group_id, group) == 0); 00167 if (result) 00168 { 00169 delete group; 00170 } 00171 return result; 00172 } |
|
find group note: uses group id extracted from object_group
Definition at line 152 of file PG_Group_Factory.cpp. References find_group(), and TAO::PG_Utils::get_tagged_component().
00153 { 00154 int result = 0; 00155 PortableGroup::TagGroupTaggedComponent tc; 00156 if (TAO::PG_Utils::get_tagged_component (object_group, tc)) 00157 { 00158 result = find_group (tc.object_group_id, group); 00159 } 00160 return result; 00161 } |
|
find group
Definition at line 147 of file PG_Group_Factory.cpp. References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), and group_map_. Referenced by find_group().
00148 { 00149 return (this->group_map_.find (group_id , group) == 0); 00150 } |
|
|
Definition at line 49 of file PG_Group_Factory.cpp. References CORBA::ORB::_duplicate(), ACE_ASSERT, factory_registry_, and manipulator_.
00053 { 00054 ACE_ASSERT (CORBA::is_nil (this->orb_.in ())); 00055 ACE_ASSERT (CORBA::is_nil (this->poa_.in ())); 00056 ACE_ASSERT (CORBA::is_nil (this->factory_registry_.in ())); 00057 00058 this->orb_ = CORBA::ORB::_duplicate(orb); 00059 this->poa_ = PortableServer::POA::_duplicate (poa); 00060 this->factory_registry_ = PortableGroup::FactoryRegistry::_duplicate (factory_registry); 00061 00062 00063 ACE_ASSERT (!CORBA::is_nil (this->orb_.in ())); 00064 ACE_ASSERT (!CORBA::is_nil (this->poa_.in ())); 00065 ACE_ASSERT (!CORBA::is_nil (this->factory_registry_.in ())); 00066 00067 this->manipulator_.init (orb, poa); 00068 } |
|
insert group. Take ownership
Definition at line 142 of file PG_Group_Factory.cpp. References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), and group_map_.
00143 { 00144 return (this->group_map_.bind (group_id, group) == 0); 00145 } |
|
insert existing group. Take ownership note: uses group id extracted from group object
Definition at line 137 of file PG_Group_Factory.cpp. References TAO::PG_Object_Group::get_object_group_id().
00138 { 00139 return insert_group (group->get_object_group_id(), group); 00140 } |
|
Definition at line 156 of file PG_Group_Factory.h. |
|
The factory registry for replica factories.
Definition at line 152 of file PG_Group_Factory.h. Referenced by create_group(), and init(). |
|
Definition at line 158 of file PG_Group_Factory.h. Referenced by create_group(), destroy_group(), find_group(), groups_at_location(), insert_group(), and ~PG_Group_Factory(). |
|
Definition at line 154 of file PG_Group_Factory.h. Referenced by create_group(), and init(). |
|
Definition at line 146 of file PG_Group_Factory.h. |
|
Reference to the POA used to create object group references.
Definition at line 149 of file PG_Group_Factory.h. |