00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TAO_PG_OBJECT_GROUP_MANAGER_H
00015 #define TAO_PG_OBJECT_GROUP_MANAGER_H
00016
00017 #include "ace/pre.h"
00018
00019 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00020 #include "orbsvcs/PortableGroupS.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 #pragma once
00024 #endif
00025
00026 #include "orbsvcs/PortableGroup/PG_ObjectGroup_Map.h"
00027 #include "orbsvcs/PortableGroup/PG_Location_Map.h"
00028
00029 #include "tao/PortableServer/Key_Adapters.h"
00030 #include "tao/PortableServer/PortableServerC.h"
00031
00032
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034
00035
00036 class TAO_PG_GenericFactory;
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 class TAO_PortableGroup_Export TAO_PG_ObjectGroupManager
00048 : public virtual POA_PortableGroup::ObjectGroupManager
00049 {
00050 public:
00051
00052
00053 TAO_PG_ObjectGroupManager (void);
00054
00055
00056 ~TAO_PG_ObjectGroupManager (void);
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 virtual PortableGroup::ObjectGroup_ptr create_member (
00068 PortableGroup::ObjectGroup_ptr object_group,
00069 const PortableGroup::Location & the_location,
00070 const char * type_id,
00071 const PortableGroup::Criteria & the_criteria
00072 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00073 ACE_THROW_SPEC ((CORBA::SystemException,
00074 PortableGroup::ObjectGroupNotFound,
00075 PortableGroup::MemberAlreadyPresent,
00076 PortableGroup::NoFactory,
00077 PortableGroup::ObjectNotCreated,
00078 PortableGroup::InvalidCriteria,
00079 PortableGroup::CannotMeetCriteria));
00080
00081
00082 virtual PortableGroup::ObjectGroup_ptr add_member (
00083 PortableGroup::ObjectGroup_ptr object_group,
00084 const PortableGroup::Location & the_location,
00085 CORBA::Object_ptr member
00086 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00087 ACE_THROW_SPEC ((CORBA::SystemException,
00088 PortableGroup::ObjectGroupNotFound,
00089 PortableGroup::MemberAlreadyPresent,
00090 PortableGroup::ObjectNotAdded));
00091
00092
00093
00094
00095
00096
00097
00098
00099 virtual PortableGroup::ObjectGroup_ptr remove_member (
00100 PortableGroup::ObjectGroup_ptr object_group,
00101 const PortableGroup::Location & the_location
00102 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00103 ACE_THROW_SPEC ((CORBA::SystemException,
00104 PortableGroup::ObjectGroupNotFound,
00105 PortableGroup::MemberNotFound));
00106
00107
00108 virtual PortableGroup::Locations * locations_of_members (
00109 PortableGroup::ObjectGroup_ptr object_group
00110 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00111 ACE_THROW_SPEC ((CORBA::SystemException,
00112 PortableGroup::ObjectGroupNotFound));
00113
00114
00115 virtual PortableGroup::ObjectGroups * groups_at_location (
00116 const PortableGroup::Location & the_location
00117 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00118 ACE_THROW_SPEC ((CORBA::SystemException));
00119
00120
00121
00122 virtual PortableGroup::ObjectGroupId get_object_group_id (
00123 PortableGroup::ObjectGroup_ptr object_group
00124 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00125 ACE_THROW_SPEC ((CORBA::SystemException,
00126 PortableGroup::ObjectGroupNotFound));
00127
00128
00129 virtual PortableGroup::ObjectGroup_ptr get_object_group_ref (
00130 PortableGroup::ObjectGroup_ptr object_group
00131 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00132 ACE_THROW_SPEC ((CORBA::SystemException,
00133 PortableGroup::ObjectGroupNotFound));
00134
00135
00136
00137 virtual CORBA::Object_ptr get_member_ref (
00138 PortableGroup::ObjectGroup_ptr object_group,
00139 const PortableGroup::Location & loc
00140 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00141 ACE_THROW_SPEC ((CORBA::SystemException,
00142 PortableGroup::ObjectGroupNotFound,
00143 PortableGroup::MemberNotFound));
00144
00145
00146
00147
00148 virtual PortableGroup::ObjectGroup_ptr get_object_group_ref_from_id (
00149 PortableGroup::ObjectGroupId group_id
00150 ACE_ENV_ARG_DECL_WITH_DEFAULTS
00151 )
00152 ACE_THROW_SPEC ((
00153 CORBA::SystemException
00154 , PortableGroup::ObjectGroupNotFound
00155 ));
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166 PortableGroup::ObjectGroup_ptr _tao_add_member (
00167 PortableGroup::ObjectGroup_ptr object_group,
00168 const PortableGroup::Location & the_location,
00169 CORBA::Object_ptr member,
00170 const char * type_id,
00171 const CORBA::Boolean propagate_member_already_present
00172 ACE_ENV_ARG_DECL)
00173 ACE_THROW_SPEC ((CORBA::SystemException,
00174 PortableGroup::MemberAlreadyPresent,
00175 PortableGroup::NoFactory));
00176
00177
00178
00179
00180
00181
00182
00183 PortableGroup::ObjectGroup_ptr create_object_group (
00184 CORBA::ULong group_id,
00185 const PortableServer::ObjectId &oid,
00186 const char * type_id,
00187 const PortableGroup::Criteria & the_criteria
00188 ACE_ENV_ARG_DECL);
00189
00190
00191
00192
00193
00194
00195 void destroy_object_group (const PortableServer::ObjectId & oid
00196 ACE_ENV_ARG_DECL);
00197
00198
00199
00200 PortableGroup::Properties * get_properties (
00201 PortableGroup::ObjectGroup_ptr object_group
00202 ACE_ENV_ARG_DECL)
00203 ACE_THROW_SPEC ((CORBA::SystemException,
00204 PortableGroup::ObjectGroupNotFound));
00205
00206
00207 char * type_id (PortableGroup::ObjectGroup_ptr object_group
00208 ACE_ENV_ARG_DECL);
00209
00210
00211
00212
00213
00214
00215 PortableGroup::ObjectGroup_ptr object_group (
00216 const PortableServer::ObjectId & oid);
00217
00218
00219 CORBA::ULong member_count (PortableGroup::ObjectGroup_ptr group
00220 ACE_ENV_ARG_DECL)
00221 ACE_THROW_SPEC ((CORBA::SystemException,
00222 PortableGroup::ObjectGroupNotFound));
00223
00224
00225
00226 void poa (PortableServer::POA_ptr p);
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236 void generic_factory (TAO_PG_GenericFactory * generic_factory);
00237
00238 protected:
00239
00240
00241
00242 PortableGroup::ObjectGroup_ptr add_member_i (
00243 PortableGroup::ObjectGroup_ptr object_group,
00244 const PortableGroup::Location & the_location,
00245 CORBA::Object_ptr member,
00246 const CORBA::Boolean check_type_id
00247 ACE_ENV_ARG_DECL)
00248 ACE_THROW_SPEC ((CORBA::SystemException,
00249 PortableGroup::ObjectGroupNotFound,
00250 PortableGroup::MemberAlreadyPresent,
00251 PortableGroup::ObjectNotAdded));
00252
00253
00254
00255 TAO_PG_ObjectGroup_Map_Entry * get_group_entry (
00256 PortableGroup::ObjectGroup_ptr object_group
00257 ACE_ENV_ARG_DECL)
00258 ACE_THROW_SPEC ((CORBA::SystemException,
00259 PortableGroup::ObjectGroupNotFound));
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 CORBA::Boolean member_already_present (
00270 const TAO_PG_ObjectGroup_Array & groups,
00271 TAO_PG_ObjectGroup_Map_Entry * group_entry);
00272
00273
00274 size_t get_object_group_position (
00275 const TAO_PG_ObjectGroup_Array & groups,
00276 TAO_PG_ObjectGroup_Map_Entry * group_entry);
00277
00278
00279
00280
00281
00282 CORBA::Boolean valid_type_id (
00283 PortableGroup::ObjectGroup_ptr object_group,
00284 TAO_PG_ObjectGroup_Map_Entry * group_entry,
00285 CORBA::Object_ptr member
00286 ACE_ENV_ARG_DECL);
00287
00288 private:
00289
00290
00291 PortableServer::POA_var poa_;
00292
00293
00294
00295 TAO_PG_ObjectGroup_Map object_group_map_;
00296
00297
00298
00299 TAO_PG_Location_Map location_map_;
00300
00301
00302
00303 TAO_PG_GenericFactory * generic_factory_;
00304
00305
00306 TAO_SYNCH_MUTEX lock_;
00307
00308 };
00309
00310 TAO_END_VERSIONED_NAMESPACE_DECL
00311
00312 #include "ace/post.h"
00313
00314 #endif