Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef TAO_PG_OBJECT_GROUP_H_
00021 #define TAO_PG_OBJECT_GROUP_H_
00022 #include "ace/pre.h"
00023
00024 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00025
00026 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00027 #pragma once
00028 #endif
00029
00030
00031
00032
00033 #include "orbsvcs/PortableGroup/PG_Property_Set.h"
00034 #include "orbsvcs/PortableGroup/PG_Location_Hash.h"
00035 #include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
00036 #include "orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h"
00037 #include "orbsvcs/PortableGroupC.h"
00038 #include "tao/PortableServer/PortableServer.h"
00039 #include "ace/Hash_Map_Manager_T.h"
00040 #include "ace/ACE.h"
00041
00042 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00043
00044
00045
00046
00047 namespace TAO_IOP
00048 {
00049 class TAO_IOR_Property;
00050 }
00051
00052
00053
00054 namespace TAO
00055 {
00056
00057
00058 class TAO_PortableGroup_Export PG_Object_Group
00059 {
00060
00061 struct MemberInfo
00062 {
00063
00064 CORBA::Object_var member_;
00065
00066
00067
00068 PortableGroup::GenericFactory_var factory_;
00069
00070
00071 PortableGroup::GenericFactory::FactoryCreationId factory_id_;
00072
00073
00074 PortableGroup::Location location_;
00075
00076
00077
00078 CORBA::Boolean is_primary_;
00079
00080
00081
00082
00083
00084
00085 MemberInfo (CORBA::Object_ptr member, const PortableGroup::Location & location);
00086
00087
00088 MemberInfo (
00089 CORBA::Object_ptr member,
00090 const PortableGroup::Location & location,
00091 PortableGroup::GenericFactory_ptr factory,
00092 PortableGroup::GenericFactory::FactoryCreationId factory_id);
00093
00094
00095 ~MemberInfo();
00096 };
00097
00098 typedef TAO_SYNCH_MUTEX MemberMapMutex;
00099 typedef ACE_Hash_Map_Manager_Ex <
00100 PortableGroup::Location,
00101 MemberInfo *,
00102 TAO_PG_Location_Hash,
00103 TAO_PG_Location_Equal_To,
00104 MemberMapMutex> MemberMap;
00105 typedef ACE_Hash_Map_Entry <PortableGroup::Location, MemberInfo *> MemberMap_Entry;
00106 typedef ACE_Hash_Map_Iterator_Ex <
00107 PortableGroup::Location,
00108 MemberInfo *,
00109 TAO_PG_Location_Hash,
00110 TAO_PG_Location_Equal_To,
00111 MemberMapMutex> MemberMap_Iterator;
00112
00113
00114
00115 public:
00116
00117
00118
00119 PG_Object_Group (
00120 CORBA::ORB_ptr orb,
00121 PortableGroup::FactoryRegistry_ptr factory_registry,
00122 TAO::PG_Object_Group_Manipulator & manipulator,
00123 CORBA::Object_ptr empty_group,
00124 const PortableGroup::TagGroupTaggedComponent & tagged_component,
00125 const char * type_id,
00126 const PortableGroup::Criteria & the_criteria,
00127 TAO::PG_Property_Set * type_properties);
00128
00129
00130
00131 ~PG_Object_Group ();
00132
00133
00134
00135
00136 public:
00137
00138 PortableGroup::ObjectGroup_ptr reference()const;
00139
00140
00141
00142
00143
00144 void get_group_specific_factories (PortableGroup::FactoryInfos & result) const;
00145
00146
00147
00148
00149 const PortableGroup::Location & get_primary_location() const;
00150
00151
00152
00153
00154
00155 PortableGroup::TypeId get_type_id ()const;
00156
00157
00158
00159
00160
00161 PortableGroup::MembershipStyleValue get_membership_style() const;
00162
00163
00164
00165
00166 PortableGroup::MinimumNumberMembersValue get_minimum_number_members () const;
00167
00168
00169
00170
00171 PortableGroup::InitialNumberMembersValue get_initial_number_members () const;
00172
00173
00174
00175
00176
00177
00178 void set_properties_dynamically (
00179 const PortableGroup::Properties & overrides);
00180
00181
00182
00183
00184 void get_properties (PortableGroup::Properties_var & result) const;
00185
00186
00187
00188
00189 PortableGroup::ObjectGroupId get_object_group_id () const;
00190
00191
00192
00193
00194
00195
00196 void add_member (
00197 const PortableGroup::Location & the_location,
00198 CORBA::Object_ptr member);
00199
00200
00201
00202
00203
00204
00205
00206
00207 int set_primary_member (
00208 TAO_IOP::TAO_IOR_Property * prop,
00209 const PortableGroup::Location & the_location);
00210
00211
00212
00213
00214 void remove_member (
00215 const PortableGroup::Location & the_location);
00216
00217
00218
00219
00220
00221 void create_member (
00222 const PortableGroup::Location & the_location,
00223 const char * type_id,
00224 const PortableGroup::Criteria & the_criteria);
00225
00226
00227
00228
00229 PortableGroup::Locations * locations_of_members (void);
00230
00231
00232
00233
00234 CORBA::Object_ptr get_member_reference (
00235 const PortableGroup::Location & the_location);
00236
00237
00238
00239
00240
00241 void initial_populate (void);
00242
00243
00244
00245
00246 void minimum_populate (void);
00247
00248
00249
00250
00251
00252 int has_member_at (const PortableGroup::Location & location );
00253
00254
00255
00256 private:
00257
00258 int increment_version ();
00259
00260 void distribute_iogr (void);
00261
00262 PortableGroup::ObjectGroup_ptr add_member_to_iogr(CORBA::Object_ptr member);
00263
00264
00265 void create_members (size_t count);
00266
00267
00268
00269
00270 private:
00271 PG_Object_Group ();
00272 PG_Object_Group (const PG_Object_Group & rhs);
00273 PG_Object_Group & operator = (const PG_Object_Group & rhs);
00274
00275
00276
00277
00278 public:
00279
00280
00281
00282 private:
00283
00284
00285
00286 private:
00287
00288
00289
00290
00291 mutable TAO_SYNCH_MUTEX internals_;
00292
00293 CORBA::ORB_var orb_;
00294
00295
00296 PortableGroup::FactoryRegistry_var factory_registry_;
00297
00298
00299
00300 TAO::PG_Object_Group_Manipulator & manipulator_;
00301
00302
00303 int empty_;
00304
00305 ACE_CString role_;
00306 PortableGroup::TypeId_var type_id_;
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316 PortableGroup::TagGroupTaggedComponent tagged_component_;
00317
00318
00319
00320
00321 PortableGroup::ObjectGroup_var reference_;
00322
00323
00324
00325
00326 PortableServer::ObjectId_var object_id_;
00327
00328
00329 MemberMap members_;
00330
00331 PortableGroup::Location primary_location_;
00332
00333
00334
00335 TAO::PG_Property_Set properties_;
00336
00337
00338
00339 PortableGroup::InitialNumberMembersValue initial_number_members_;
00340 PortableGroup::MinimumNumberMembersValue minimum_number_members_;
00341 PortableGroup::FactoryInfos group_specific_factories_;
00342
00343 };
00344 }
00345
00346 TAO_END_VERSIONED_NAMESPACE_DECL
00347
00348 #include "ace/post.h"
00349
00350 #endif // TAO_PG_OBJECT_GROUP_H_