00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ___HxCorbaVxSegmentation_tie_h__
00016 #define ___HxCorbaVxSegmentation_tie_h__
00017
00018 #include <HxCorbaVxSegmentation_skel.h>
00019
00020 #ifndef OB_INTEGER_VERSION
00021 # error No ORBacus version defined! Is <OB/CORBA.h> included?
00022 #endif
00023
00024 #ifndef OB_NO_VERSION_CHECK
00025 # if (OB_INTEGER_VERSION != 4010000L)
00026 # error ORBacus version mismatch!
00027 # endif
00028 #endif
00029
00030
00031
00032
00033 namespace POA_HxCorba
00034 {
00035
00036
00037
00038
00039 template<class T>
00040 class VxSegment_tie : virtual public VxSegment
00041 {
00042 T* ptr_;
00043 PortableServer::POA_ptr poa_;
00044 CORBA::Boolean rel_;
00045
00046 VxSegment_tie(const VxSegment_tie<T>&) { }
00047 void operator=(const VxSegment_tie<T>&) { }
00048
00049 public:
00050
00051 VxSegment_tie(T& t)
00052 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053 {
00054 }
00055
00056 VxSegment_tie(T& t, PortableServer::POA_ptr poa)
00057 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058 {
00059 }
00060
00061 VxSegment_tie(T* p, CORBA::Boolean release = true)
00062 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063 {
00064 }
00065
00066 VxSegment_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00067 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00068 {
00069 }
00070
00071 virtual
00072 ~VxSegment_tie()
00073 {
00074 if(rel_)
00075 delete ptr_;
00076
00077 CORBA::release(poa_);
00078 }
00079
00080 T*
00081 _tied_object()
00082 {
00083 return ptr_;
00084 }
00085
00086 void
00087 _tied_object(T& obj)
00088 {
00089 if(rel_)
00090 delete ptr_;
00091
00092 ptr_ = &obj;
00093 rel_ = false;
00094 }
00095
00096 void
00097 _tied_object(T* obj, CORBA::Boolean release = true)
00098 {
00099 if(rel_)
00100 delete ptr_;
00101
00102 ptr_ = obj;
00103 rel_ = release;
00104 }
00105
00106 CORBA::Boolean
00107 _is_owner()
00108 {
00109 return rel_;
00110 }
00111
00112 void
00113 _is_owner(CORBA::Boolean b)
00114 {
00115 rel_ = b;
00116 }
00117
00118 virtual CORBA::Long
00119 start()
00120 throw(CORBA::SystemException)
00121 {
00122 return ptr_ -> start();
00123 }
00124
00125 virtual CORBA::Long
00126 end()
00127 throw(CORBA::SystemException)
00128 {
00129 return ptr_ -> end();
00130 }
00131
00132 virtual CORBA::Long
00133 length()
00134 throw(CORBA::SystemException)
00135 {
00136 return ptr_ -> length();
00137 }
00138
00139 virtual HxCorba::StringSeq*
00140 getIds()
00141 throw(CORBA::SystemException)
00142 {
00143 return ptr_ -> getIds();
00144 }
00145
00146 virtual HxCorba::StringSeq*
00147 getTypes()
00148 throw(CORBA::SystemException)
00149 {
00150 return ptr_ -> getTypes();
00151 }
00152
00153 virtual CORBA::Long
00154 getInt(const char* id)
00155 throw(CORBA::SystemException)
00156 {
00157 return ptr_ -> getInt(id);
00158 }
00159
00160 virtual CORBA::Double
00161 getDouble(const char* id)
00162 throw(CORBA::SystemException)
00163 {
00164 return ptr_ -> getDouble(id);
00165 }
00166
00167 virtual char*
00168 getString(const char* id)
00169 throw(CORBA::SystemException)
00170 {
00171 return ptr_ -> getString(id);
00172 }
00173
00174 virtual CORBA::Long
00175 getIntFlag(const char* id,
00176 CORBA::Boolean_out present)
00177 throw(CORBA::SystemException)
00178 {
00179 return ptr_ -> getIntFlag(id, present);
00180 }
00181
00182 virtual CORBA::Double
00183 getDoubleFlag(const char* id,
00184 CORBA::Boolean_out present)
00185 throw(CORBA::SystemException)
00186 {
00187 return ptr_ -> getDoubleFlag(id, present);
00188 }
00189
00190 virtual char*
00191 getStringFlag(const char* id,
00192 CORBA::Boolean_out present)
00193 throw(CORBA::SystemException)
00194 {
00195 return ptr_ -> getStringFlag(id, present);
00196 }
00197
00198 PortableServer::POA_ptr _default_POA()
00199 {
00200 if(!CORBA::is_nil(poa_))
00201 return PortableServer::POA::_duplicate(poa_);
00202 else
00203 return VxSegment::_default_POA();
00204 }
00205 };
00206
00207
00208
00209
00210 template<class T>
00211 class VxSegmentation_tie : virtual public VxSegmentation
00212 {
00213 T* ptr_;
00214 PortableServer::POA_ptr poa_;
00215 CORBA::Boolean rel_;
00216
00217 VxSegmentation_tie(const VxSegmentation_tie<T>&) { }
00218 void operator=(const VxSegmentation_tie<T>&) { }
00219
00220 public:
00221
00222 VxSegmentation_tie(T& t)
00223 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00224 {
00225 }
00226
00227 VxSegmentation_tie(T& t, PortableServer::POA_ptr poa)
00228 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00229 {
00230 }
00231
00232 VxSegmentation_tie(T* p, CORBA::Boolean release = true)
00233 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00234 {
00235 }
00236
00237 VxSegmentation_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00238 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00239 {
00240 }
00241
00242 virtual
00243 ~VxSegmentation_tie()
00244 {
00245 if(rel_)
00246 delete ptr_;
00247
00248 CORBA::release(poa_);
00249 }
00250
00251 T*
00252 _tied_object()
00253 {
00254 return ptr_;
00255 }
00256
00257 void
00258 _tied_object(T& obj)
00259 {
00260 if(rel_)
00261 delete ptr_;
00262
00263 ptr_ = &obj;
00264 rel_ = false;
00265 }
00266
00267 void
00268 _tied_object(T* obj, CORBA::Boolean release = true)
00269 {
00270 if(rel_)
00271 delete ptr_;
00272
00273 ptr_ = obj;
00274 rel_ = release;
00275 }
00276
00277 CORBA::Boolean
00278 _is_owner()
00279 {
00280 return rel_;
00281 }
00282
00283 void
00284 _is_owner(CORBA::Boolean b)
00285 {
00286 rel_ = b;
00287 }
00288
00289 virtual CORBA::Long
00290 size()
00291 throw(CORBA::SystemException)
00292 {
00293 return ptr_ -> size();
00294 }
00295
00296 virtual HxCorba::VxSegmentSeq*
00297 getAll()
00298 throw(CORBA::SystemException)
00299 {
00300 return ptr_ -> getAll();
00301 }
00302
00303 virtual HxCorba::VxTimeSpanSeq*
00304 getTimeSpans()
00305 throw(CORBA::SystemException)
00306 {
00307 return ptr_ -> getTimeSpans();
00308 }
00309
00310 virtual HxCorba::StringSeq*
00311 getIds()
00312 throw(CORBA::SystemException)
00313 {
00314 return ptr_ -> getIds();
00315 }
00316
00317 virtual HxCorba::StringSeq*
00318 getTypes()
00319 throw(CORBA::SystemException)
00320 {
00321 return ptr_ -> getTypes();
00322 }
00323
00324 virtual HxCorba::VxSegment_ptr
00325 getSegment(CORBA::Long index)
00326 throw(CORBA::SystemException)
00327 {
00328 return ptr_ -> getSegment(index);
00329 }
00330
00331 virtual HxCorba::VxSegment_ptr
00332 mapsToSegment(CORBA::Long timeSpan)
00333 throw(CORBA::SystemException)
00334 {
00335 return ptr_ -> mapsToSegment(timeSpan);
00336 }
00337
00338 PortableServer::POA_ptr _default_POA()
00339 {
00340 if(!CORBA::is_nil(poa_))
00341 return PortableServer::POA::_duplicate(poa_);
00342 else
00343 return VxSegmentation::_default_POA();
00344 }
00345 };
00346
00347
00348
00349
00350 template<class T>
00351 class VxSegmentationFactory_tie : virtual public VxSegmentationFactory
00352 {
00353 T* ptr_;
00354 PortableServer::POA_ptr poa_;
00355 CORBA::Boolean rel_;
00356
00357 VxSegmentationFactory_tie(const VxSegmentationFactory_tie<T>&) { }
00358 void operator=(const VxSegmentationFactory_tie<T>&) { }
00359
00360 public:
00361
00362 VxSegmentationFactory_tie(T& t)
00363 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00364 {
00365 }
00366
00367 VxSegmentationFactory_tie(T& t, PortableServer::POA_ptr poa)
00368 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00369 {
00370 }
00371
00372 VxSegmentationFactory_tie(T* p, CORBA::Boolean release = true)
00373 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00374 {
00375 }
00376
00377 VxSegmentationFactory_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00378 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00379 {
00380 }
00381
00382 virtual
00383 ~VxSegmentationFactory_tie()
00384 {
00385 if(rel_)
00386 delete ptr_;
00387
00388 CORBA::release(poa_);
00389 }
00390
00391 T*
00392 _tied_object()
00393 {
00394 return ptr_;
00395 }
00396
00397 void
00398 _tied_object(T& obj)
00399 {
00400 if(rel_)
00401 delete ptr_;
00402
00403 ptr_ = &obj;
00404 rel_ = false;
00405 }
00406
00407 void
00408 _tied_object(T* obj, CORBA::Boolean release = true)
00409 {
00410 if(rel_)
00411 delete ptr_;
00412
00413 ptr_ = obj;
00414 rel_ = release;
00415 }
00416
00417 CORBA::Boolean
00418 _is_owner()
00419 {
00420 return rel_;
00421 }
00422
00423 void
00424 _is_owner(CORBA::Boolean b)
00425 {
00426 rel_ = b;
00427 }
00428
00429 virtual HxCorba::VxSegmentation_ptr
00430 makeVxSegmentation(const char* filename)
00431 throw(CORBA::SystemException)
00432 {
00433 return ptr_ -> makeVxSegmentation(filename);
00434 }
00435
00436 virtual HxCorba::VxSegmentation_ptr
00437 importSegmentation(HxCorba::VxSegmentation_ptr seg)
00438 throw(CORBA::SystemException)
00439 {
00440 return ptr_ -> importSegmentation(seg);
00441 }
00442
00443 PortableServer::POA_ptr _default_POA()
00444 {
00445 if(!CORBA::is_nil(poa_))
00446 return PortableServer::POA::_duplicate(poa_);
00447 else
00448 return VxSegmentationFactory::_default_POA();
00449 }
00450 };
00451
00452 }
00453
00454 #endif