00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ___HxCorbaPolyline2d_tie_h__
00016 #define ___HxCorbaPolyline2d_tie_h__
00017
00018 #include <HxCorbaPolyline2d_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 Polyline2dData_tie : virtual public Polyline2dData
00041 {
00042 T* ptr_;
00043 PortableServer::POA_ptr poa_;
00044 CORBA::Boolean rel_;
00045
00046 Polyline2dData_tie(const Polyline2dData_tie<T>&) { }
00047 void operator=(const Polyline2dData_tie<T>&) { }
00048
00049 public:
00050
00051 Polyline2dData_tie(T& t)
00052 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053 {
00054 }
00055
00056 Polyline2dData_tie(T& t, PortableServer::POA_ptr poa)
00057 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058 {
00059 }
00060
00061 Polyline2dData_tie(T* p, CORBA::Boolean release = true)
00062 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063 {
00064 }
00065
00066 Polyline2dData_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 ~Polyline2dData_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::Boolean
00119 getClosed()
00120 throw(CORBA::SystemException)
00121 {
00122 return ptr_ -> getClosed();
00123 }
00124
00125 virtual CORBA::Long
00126 getNrPoints()
00127 throw(CORBA::SystemException)
00128 {
00129 return ptr_ -> getNrPoints();
00130 }
00131
00132 virtual HxCorba::PointR2
00133 getPoint(CORBA::Long i)
00134 throw(CORBA::SystemException)
00135 {
00136 return ptr_ -> getPoint(i);
00137 }
00138
00139 virtual HxCorba::PointR2Seq*
00140 getPoints()
00141 throw(CORBA::SystemException)
00142 {
00143 return ptr_ -> getPoints();
00144 }
00145
00146 PortableServer::POA_ptr _default_POA()
00147 {
00148 if(!CORBA::is_nil(poa_))
00149 return PortableServer::POA::_duplicate(poa_);
00150 else
00151 return Polyline2dData::_default_POA();
00152 }
00153 };
00154
00155
00156
00157
00158 template<class T>
00159 class Polyline2d_tie : virtual public Polyline2d
00160 {
00161 T* ptr_;
00162 PortableServer::POA_ptr poa_;
00163 CORBA::Boolean rel_;
00164
00165 Polyline2d_tie(const Polyline2d_tie<T>&) { }
00166 void operator=(const Polyline2d_tie<T>&) { }
00167
00168 public:
00169
00170 Polyline2d_tie(T& t)
00171 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00172 {
00173 }
00174
00175 Polyline2d_tie(T& t, PortableServer::POA_ptr poa)
00176 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00177 {
00178 }
00179
00180 Polyline2d_tie(T* p, CORBA::Boolean release = true)
00181 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00182 {
00183 }
00184
00185 Polyline2d_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00186 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00187 {
00188 }
00189
00190 virtual
00191 ~Polyline2d_tie()
00192 {
00193 if(rel_)
00194 delete ptr_;
00195
00196 CORBA::release(poa_);
00197 }
00198
00199 T*
00200 _tied_object()
00201 {
00202 return ptr_;
00203 }
00204
00205 void
00206 _tied_object(T& obj)
00207 {
00208 if(rel_)
00209 delete ptr_;
00210
00211 ptr_ = &obj;
00212 rel_ = false;
00213 }
00214
00215 void
00216 _tied_object(T* obj, CORBA::Boolean release = true)
00217 {
00218 if(rel_)
00219 delete ptr_;
00220
00221 ptr_ = obj;
00222 rel_ = release;
00223 }
00224
00225 CORBA::Boolean
00226 _is_owner()
00227 {
00228 return rel_;
00229 }
00230
00231 void
00232 _is_owner(CORBA::Boolean b)
00233 {
00234 rel_ = b;
00235 }
00236
00237 virtual CORBA::Boolean
00238 getClosed()
00239 throw(CORBA::SystemException)
00240 {
00241 return ptr_ -> getClosed();
00242 }
00243
00244 virtual CORBA::Long
00245 getNrPoints()
00246 throw(CORBA::SystemException)
00247 {
00248 return ptr_ -> getNrPoints();
00249 }
00250
00251 virtual HxCorba::PointR2
00252 getPoint(CORBA::Long i)
00253 throw(CORBA::SystemException)
00254 {
00255 return ptr_ -> getPoint(i);
00256 }
00257
00258 virtual HxCorba::PointR2Seq*
00259 getPoints()
00260 throw(CORBA::SystemException)
00261 {
00262 return ptr_ -> getPoints();
00263 }
00264
00265 PortableServer::POA_ptr _default_POA()
00266 {
00267 if(!CORBA::is_nil(poa_))
00268 return PortableServer::POA::_duplicate(poa_);
00269 else
00270 return Polyline2d::_default_POA();
00271 }
00272 };
00273
00274
00275
00276
00277 template<class T>
00278 class PolylineFactory_tie : virtual public PolylineFactory
00279 {
00280 T* ptr_;
00281 PortableServer::POA_ptr poa_;
00282 CORBA::Boolean rel_;
00283
00284 PolylineFactory_tie(const PolylineFactory_tie<T>&) { }
00285 void operator=(const PolylineFactory_tie<T>&) { }
00286
00287 public:
00288
00289 PolylineFactory_tie(T& t)
00290 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00291 {
00292 }
00293
00294 PolylineFactory_tie(T& t, PortableServer::POA_ptr poa)
00295 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00296 {
00297 }
00298
00299 PolylineFactory_tie(T* p, CORBA::Boolean release = true)
00300 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00301 {
00302 }
00303
00304 PolylineFactory_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00305 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00306 {
00307 }
00308
00309 virtual
00310 ~PolylineFactory_tie()
00311 {
00312 if(rel_)
00313 delete ptr_;
00314
00315 CORBA::release(poa_);
00316 }
00317
00318 T*
00319 _tied_object()
00320 {
00321 return ptr_;
00322 }
00323
00324 void
00325 _tied_object(T& obj)
00326 {
00327 if(rel_)
00328 delete ptr_;
00329
00330 ptr_ = &obj;
00331 rel_ = false;
00332 }
00333
00334 void
00335 _tied_object(T* obj, CORBA::Boolean release = true)
00336 {
00337 if(rel_)
00338 delete ptr_;
00339
00340 ptr_ = obj;
00341 rel_ = release;
00342 }
00343
00344 CORBA::Boolean
00345 _is_owner()
00346 {
00347 return rel_;
00348 }
00349
00350 void
00351 _is_owner(CORBA::Boolean b)
00352 {
00353 rel_ = b;
00354 }
00355
00356 virtual HxCorba::Polyline2d_ptr
00357 importPolyline(HxCorba::Polyline2dData_ptr data)
00358 throw(CORBA::SystemException)
00359 {
00360 return ptr_ -> importPolyline(data);
00361 }
00362
00363 virtual HxCorba::Polyline2d_ptr
00364 createPolyline(const HxCorba::PointR2Seq& points,
00365 CORBA::Boolean closed)
00366 throw(CORBA::SystemException)
00367 {
00368 return ptr_ -> createPolyline(points, closed);
00369 }
00370
00371 PortableServer::POA_ptr _default_POA()
00372 {
00373 if(!CORBA::is_nil(poa_))
00374 return PortableServer::POA::_duplicate(poa_);
00375 else
00376 return PolylineFactory::_default_POA();
00377 }
00378 };
00379
00380 }
00381
00382 #endif