#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) throw (CORBA::SystemException, PortableGroup::NoFactory, PortableGroup::ObjectNotCreated, PortableGroup::InvalidCriteria, PortableGroup::InvalidProperty, PortableGroup::CannotMeetCriteria) |
void | delete_group (PortableGroup::ObjectGroup_ptr object_group) throw (CORBA::SystemException, PortableGroup::ObjectNotFound) |
void | delete_group (PortableGroup::ObjectGroupId group_id) throw (CORBA::SystemException, PortableGroup::ObjectNotFound) |
PortableGroup::ObjectGroups * | groups_at_location (const PortableGroup::Location &the_location) throw (CORBA::SystemException) |
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 73 of file PG_Group_Factory.cpp. References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_NEW_THROW_EX, ACE_THROW_RETURN, PortableGroup::Criteria, and TAO::PG_Utils::get_tagged_component().
00084 { 00085 /////////////////////////////////// 00086 // Create an empty group reference 00087 00088 PortableGroup::ObjectGroupId group_id = 0; 00089 PortableGroup::ObjectGroup_var empty_group = 00090 this->manipulator_.create_object_group ( 00091 type_id, 00092 this->domain_id_, 00093 group_id 00094 ACE_ENV_ARG_PARAMETER); 00095 ACE_CHECK_RETURN (0); 00096 00097 // pick up the object group information as assigned by 00098 // ObjectGroupManager 00099 00100 PortableGroup::TagGroupTaggedComponent tagged_component; 00101 if (! TAO::PG_Utils::get_tagged_component (empty_group, tagged_component)) 00102 { 00103 ACE_THROW_RETURN (PortableGroup::ObjectNotCreated(), 0); 00104 } 00105 00106 TAO::PG_Object_Group * objectGroup = 0; 00107 00108 ACE_NEW_THROW_EX ( 00109 objectGroup, 00110 TAO::PG_Object_Group ( 00111 this->orb_.in (), 00112 this->factory_registry_.in (), 00113 this->manipulator_, 00114 empty_group.in (), 00115 tagged_component, 00116 type_id, 00117 the_criteria, 00118 typeid_properties 00119 ), 00120 CORBA::NO_MEMORY()); 00121 00122 if (this->group_map_.bind (group_id, objectGroup) != 0) 00123 { 00124 delete objectGroup; 00125 ACE_THROW_RETURN (PortableGroup::ObjectNotCreated(), 0); 00126 } 00127 return objectGroup; 00128 } |
|
Definition at line 142 of file PG_Group_Factory.cpp. References ACE_THROW.
00146 { 00147 if (! destroy_group (group_id)) 00148 { 00149 ACE_THROW (PortableGroup::ObjectNotFound ()); 00150 } 00151 } |
|
Definition at line 130 of file PG_Group_Factory.cpp. References ACE_THROW.
00134 { 00135 if (! destroy_group (object_group)) 00136 { 00137 ACE_THROW (PortableGroup::ObjectNotFound ()); 00138 } 00139 } |
|
remove group from map and delete it. note: uses group id extracted from object_group
Definition at line 191 of file PG_Group_Factory.cpp. References destroy_group(), and TAO::PG_Utils::get_tagged_component().
00192 { 00193 PortableGroup::TagGroupTaggedComponent tc; 00194 TAO::PG_Utils::get_tagged_component (object_group, tc); 00195 return destroy_group (tc.object_group_id); 00196 } |
|
remove group from map and delete it.
Definition at line 180 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 destroy_group().
00181 { 00182 ::TAO::PG_Object_Group * group = 0; 00183 int result = (this->group_map_.unbind (group_id, group) == 0); 00184 if (result) 00185 { 00186 delete group; 00187 } 00188 return result; 00189 } |
|
find group note: uses group id extracted from object_group
Definition at line 169 of file PG_Group_Factory.cpp. References find_group(), and TAO::PG_Utils::get_tagged_component().
00170 { 00171 int result = 0; 00172 PortableGroup::TagGroupTaggedComponent tc; 00173 if (TAO::PG_Utils::get_tagged_component (object_group, tc)) 00174 { 00175 result = find_group (tc.object_group_id, group); 00176 } 00177 return result; 00178 } |
|
find group
Definition at line 164 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().
00165 { 00166 return (this->group_map_.find (group_id , group) == 0); 00167 } |
|
Definition at line 201 of file PG_Group_Factory.cpp. References ACE_CHECK_RETURN, ACE_NEW_THROW_EX, Group_Map_Iterator, TAO::PG_Object_Group::has_member_at(), PortableGroup::Location, PortableGroup::ObjectGroups, and TAO::PG_Object_Group::reference().
00205 { 00206 size_t upper_limit = this->group_map_.current_size (); 00207 PortableGroup::ObjectGroups * result = 0; 00208 ACE_NEW_THROW_EX ( 00209 result, 00210 PortableGroup::ObjectGroups (upper_limit), 00211 CORBA::NO_MEMORY()); 00212 ACE_CHECK_RETURN (0); 00213 00214 result->length(upper_limit); 00215 00216 size_t group_count = 0; 00217 for (Group_Map_Iterator it = this->group_map_.begin (); 00218 it != this->group_map_.end (); 00219 ++it) 00220 { 00221 TAO::PG_Object_Group * group = (*it).int_id_; 00222 if (group->has_member_at (the_location)) 00223 { 00224 (*result)[group_count] = group->reference (); 00225 ++group_count; 00226 } 00227 } 00228 result->length (group_count); 00229 return result; 00230 } |
|
Definition at line 49 of file PG_Group_Factory.cpp. References CORBA::ORB::_duplicate(), ACE_ASSERT, ACE_ENV_ARG_PARAMETER, factory_registry_, and manipulator_.
00054 { 00055 ACE_ASSERT (CORBA::is_nil (this->orb_.in ())); 00056 ACE_ASSERT (CORBA::is_nil (this->poa_.in ())); 00057 ACE_ASSERT (CORBA::is_nil (this->factory_registry_.in ())); 00058 00059 this->orb_ = CORBA::ORB::_duplicate(orb); 00060 this->poa_ = PortableServer::POA::_duplicate (poa); 00061 this->factory_registry_ = PortableGroup::FactoryRegistry::_duplicate (factory_registry); 00062 00063 00064 ACE_ASSERT (!CORBA::is_nil (this->orb_.in ())); 00065 ACE_ASSERT (!CORBA::is_nil (this->poa_.in ())); 00066 ACE_ASSERT (!CORBA::is_nil (this->factory_registry_.in ())); 00067 00068 this->manipulator_.init (orb, poa ACE_ENV_ARG_PARAMETER); 00069 // ACE_CHECK; 00070 } |
|
insert group. Take ownership
Definition at line 159 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_.
00160 { 00161 return (this->group_map_.bind (group_id, group) == 0); 00162 } |
|
insert existing group. Take ownership note: uses group id extracted from group object
Definition at line 154 of file PG_Group_Factory.cpp. References TAO::PG_Object_Group::get_object_group_id().
00155 { 00156 return insert_group (group->get_object_group_id(), group); 00157 } |
|
Definition at line 172 of file PG_Group_Factory.h. |
|
The factory registry for replica factories.
Definition at line 168 of file PG_Group_Factory.h. Referenced by init(). |
|
Definition at line 174 of file PG_Group_Factory.h. Referenced by destroy_group(), find_group(), insert_group(), and ~PG_Group_Factory(). |
|
Definition at line 170 of file PG_Group_Factory.h. Referenced by init(). |
|
Definition at line 162 of file PG_Group_Factory.h. |
|
Reference to the POA used to create object group references.
Definition at line 165 of file PG_Group_Factory.h. |