00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ___HxCorbaBSplineCurve_tie_h__
00016 #define ___HxCorbaBSplineCurve_tie_h__
00017
00018 #include <HxCorbaBSplineCurve_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 BSplineCurve_tie : virtual public BSplineCurve
00041 {
00042 T* ptr_;
00043 PortableServer::POA_ptr poa_;
00044 CORBA::Boolean rel_;
00045
00046 BSplineCurve_tie(const BSplineCurve_tie<T>&) { }
00047 void operator=(const BSplineCurve_tie<T>&) { }
00048
00049 public:
00050
00051 BSplineCurve_tie(T& t)
00052 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053 {
00054 }
00055
00056 BSplineCurve_tie(T& t, PortableServer::POA_ptr poa)
00057 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058 {
00059 }
00060
00061 BSplineCurve_tie(T* p, CORBA::Boolean release = true)
00062 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063 {
00064 }
00065
00066 BSplineCurve_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 ~BSplineCurve_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 HxCorba::BSplineType
00119 curveType()
00120 throw(CORBA::SystemException)
00121 {
00122 return ptr_ -> curveType();
00123 }
00124
00125 virtual CORBA::Long
00126 degree()
00127 throw(CORBA::SystemException)
00128 {
00129 return ptr_ -> degree();
00130 }
00131
00132 virtual CORBA::Double
00133 minT()
00134 throw(CORBA::SystemException)
00135 {
00136 return ptr_ -> minT();
00137 }
00138
00139 virtual CORBA::Double
00140 maxT()
00141 throw(CORBA::SystemException)
00142 {
00143 return ptr_ -> maxT();
00144 }
00145
00146 virtual HxCorba::PointR2
00147 C(CORBA::Double t)
00148 throw(CORBA::SystemException)
00149 {
00150 return ptr_ -> C(t);
00151 }
00152
00153 virtual HxCorba::Polyline2d_ptr
00154 sampleC(CORBA::Long np)
00155 throw(CORBA::SystemException)
00156 {
00157 return ptr_ -> sampleC(np);
00158 }
00159
00160 virtual CORBA::Double
00161 length(CORBA::Long np)
00162 throw(CORBA::SystemException)
00163 {
00164 return ptr_ -> length(np);
00165 }
00166
00167 virtual HxCorba::Polyline2d_ptr
00168 controlP()
00169 throw(CORBA::SystemException)
00170 {
00171 return ptr_ -> controlP();
00172 }
00173
00174 virtual HxCorba::PointR2
00175 center()
00176 throw(CORBA::SystemException)
00177 {
00178 return ptr_ -> center();
00179 }
00180
00181 virtual CORBA::Long
00182 numP()
00183 throw(CORBA::SystemException)
00184 {
00185 return ptr_ -> numP();
00186 }
00187
00188 virtual HxCorba::PointR2
00189 P(CORBA::Long i)
00190 throw(CORBA::SystemException)
00191 {
00192 return ptr_ -> P(i);
00193 }
00194
00195 virtual HxCorba::PointR2Seq*
00196 allP()
00197 throw(CORBA::SystemException)
00198 {
00199 return ptr_ -> allP();
00200 }
00201
00202 PortableServer::POA_ptr _default_POA()
00203 {
00204 if(!CORBA::is_nil(poa_))
00205 return PortableServer::POA::_duplicate(poa_);
00206 else
00207 return BSplineCurve::_default_POA();
00208 }
00209 };
00210
00211
00212
00213
00214 template<class T>
00215 class SampledBSplineCurve_tie : virtual public SampledBSplineCurve
00216 {
00217 T* ptr_;
00218 PortableServer::POA_ptr poa_;
00219 CORBA::Boolean rel_;
00220
00221 SampledBSplineCurve_tie(const SampledBSplineCurve_tie<T>&) { }
00222 void operator=(const SampledBSplineCurve_tie<T>&) { }
00223
00224 public:
00225
00226 SampledBSplineCurve_tie(T& t)
00227 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00228 {
00229 }
00230
00231 SampledBSplineCurve_tie(T& t, PortableServer::POA_ptr poa)
00232 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00233 {
00234 }
00235
00236 SampledBSplineCurve_tie(T* p, CORBA::Boolean release = true)
00237 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00238 {
00239 }
00240
00241 SampledBSplineCurve_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00242 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00243 {
00244 }
00245
00246 virtual
00247 ~SampledBSplineCurve_tie()
00248 {
00249 if(rel_)
00250 delete ptr_;
00251
00252 CORBA::release(poa_);
00253 }
00254
00255 T*
00256 _tied_object()
00257 {
00258 return ptr_;
00259 }
00260
00261 void
00262 _tied_object(T& obj)
00263 {
00264 if(rel_)
00265 delete ptr_;
00266
00267 ptr_ = &obj;
00268 rel_ = false;
00269 }
00270
00271 void
00272 _tied_object(T* obj, CORBA::Boolean release = true)
00273 {
00274 if(rel_)
00275 delete ptr_;
00276
00277 ptr_ = obj;
00278 rel_ = release;
00279 }
00280
00281 CORBA::Boolean
00282 _is_owner()
00283 {
00284 return rel_;
00285 }
00286
00287 void
00288 _is_owner(CORBA::Boolean b)
00289 {
00290 rel_ = b;
00291 }
00292
00293 virtual HxCorba::BSplineCurve_ptr
00294 continuousCurve()
00295 throw(CORBA::SystemException)
00296 {
00297 return ptr_ -> continuousCurve();
00298 }
00299
00300 virtual CORBA::Long
00301 nSamples()
00302 throw(CORBA::SystemException)
00303 {
00304 return ptr_ -> nSamples();
00305 }
00306
00307 virtual HxCorba::Polyline2d_ptr
00308 CPoly()
00309 throw(CORBA::SystemException)
00310 {
00311 return ptr_ -> CPoly();
00312 }
00313
00314 virtual HxCorba::PointR2
00315 C(CORBA::Long i)
00316 throw(CORBA::SystemException)
00317 {
00318 return ptr_ -> C(i);
00319 }
00320
00321 virtual HxCorba::PointR2Seq*
00322 allC()
00323 throw(CORBA::SystemException)
00324 {
00325 return ptr_ -> allC();
00326 }
00327
00328 virtual CORBA::Double
00329 length()
00330 throw(CORBA::SystemException)
00331 {
00332 return ptr_ -> length();
00333 }
00334
00335 virtual HxCorba::Polyline2d_ptr
00336 controlP()
00337 throw(CORBA::SystemException)
00338 {
00339 return ptr_ -> controlP();
00340 }
00341
00342 virtual CORBA::Long
00343 numP()
00344 throw(CORBA::SystemException)
00345 {
00346 return ptr_ -> numP();
00347 }
00348
00349 virtual HxCorba::PointR2Seq*
00350 allP()
00351 throw(CORBA::SystemException)
00352 {
00353 return ptr_ -> allP();
00354 }
00355
00356 PortableServer::POA_ptr _default_POA()
00357 {
00358 if(!CORBA::is_nil(poa_))
00359 return PortableServer::POA::_duplicate(poa_);
00360 else
00361 return SampledBSplineCurve::_default_POA();
00362 }
00363 };
00364
00365
00366
00367
00368 template<class T>
00369 class BSplineFactory_tie : virtual public BSplineFactory
00370 {
00371 T* ptr_;
00372 PortableServer::POA_ptr poa_;
00373 CORBA::Boolean rel_;
00374
00375 BSplineFactory_tie(const BSplineFactory_tie<T>&) { }
00376 void operator=(const BSplineFactory_tie<T>&) { }
00377
00378 public:
00379
00380 BSplineFactory_tie(T& t)
00381 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00382 {
00383 }
00384
00385 BSplineFactory_tie(T& t, PortableServer::POA_ptr poa)
00386 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00387 {
00388 }
00389
00390 BSplineFactory_tie(T* p, CORBA::Boolean release = true)
00391 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00392 {
00393 }
00394
00395 BSplineFactory_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00396 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00397 {
00398 }
00399
00400 virtual
00401 ~BSplineFactory_tie()
00402 {
00403 if(rel_)
00404 delete ptr_;
00405
00406 CORBA::release(poa_);
00407 }
00408
00409 T*
00410 _tied_object()
00411 {
00412 return ptr_;
00413 }
00414
00415 void
00416 _tied_object(T& obj)
00417 {
00418 if(rel_)
00419 delete ptr_;
00420
00421 ptr_ = &obj;
00422 rel_ = false;
00423 }
00424
00425 void
00426 _tied_object(T* obj, CORBA::Boolean release = true)
00427 {
00428 if(rel_)
00429 delete ptr_;
00430
00431 ptr_ = obj;
00432 rel_ = release;
00433 }
00434
00435 CORBA::Boolean
00436 _is_owner()
00437 {
00438 return rel_;
00439 }
00440
00441 void
00442 _is_owner(CORBA::Boolean b)
00443 {
00444 rel_ = b;
00445 }
00446
00447 virtual HxCorba::BSplineCurve_ptr
00448 makeUniformBSpline(HxCorba::Polyline2d_ptr cp,
00449 CORBA::Long degree)
00450 throw(CORBA::SystemException)
00451 {
00452 return ptr_ -> makeUniformBSpline(cp, degree);
00453 }
00454
00455 virtual HxCorba::BSplineCurve_ptr
00456 makeInterpolatingBSpline(HxCorba::Polyline2d_ptr cp)
00457 throw(CORBA::SystemException)
00458 {
00459 return ptr_ -> makeInterpolatingBSpline(cp);
00460 }
00461
00462 virtual HxCorba::SampledBSplineCurve_ptr
00463 makeUniformSampledBSpline(HxCorba::Polyline2d_ptr cp,
00464 CORBA::Long degree,
00465 CORBA::Double distance)
00466 throw(CORBA::SystemException)
00467 {
00468 return ptr_ -> makeUniformSampledBSpline(cp, degree, distance);
00469 }
00470
00471 virtual HxCorba::SampledBSplineCurve_ptr
00472 makeInterpolatingSampledBSpline(HxCorba::Polyline2d_ptr cp,
00473 CORBA::Double distance)
00474 throw(CORBA::SystemException)
00475 {
00476 return ptr_ -> makeInterpolatingSampledBSpline(cp, distance);
00477 }
00478
00479 PortableServer::POA_ptr _default_POA()
00480 {
00481 if(!CORBA::is_nil(poa_))
00482 return PortableServer::POA::_duplicate(poa_);
00483 else
00484 return BSplineFactory::_default_POA();
00485 }
00486 };
00487
00488 }
00489
00490 #endif