00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ___HxCorbaConstructor_tie_h__
00016 #define ___HxCorbaConstructor_tie_h__
00017
00018 #include <HxCorbaConstructor_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 Constructor_tie : virtual public Constructor
00041 {
00042 T* ptr_;
00043 PortableServer::POA_ptr poa_;
00044 CORBA::Boolean rel_;
00045
00046 Constructor_tie(const Constructor_tie<T>&) { }
00047 void operator=(const Constructor_tie<T>&) { }
00048
00049 public:
00050
00051 Constructor_tie(T& t)
00052 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053 {
00054 }
00055
00056 Constructor_tie(T& t, PortableServer::POA_ptr poa)
00057 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058 {
00059 }
00060
00061 Constructor_tie(T* p, CORBA::Boolean release = true)
00062 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063 {
00064 }
00065
00066 Constructor_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 ~Constructor_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::Object_ptr
00119 getInitialObject(const char* name)
00120 throw(CORBA::SystemException)
00121 {
00122 return ptr_ -> getInitialObject(name);
00123 }
00124
00125 virtual char*
00126 getLastError()
00127 throw(CORBA::SystemException)
00128 {
00129 return ptr_ -> getLastError();
00130 }
00131
00132 virtual HxCorba::TagList_ptr
00133 emptyTagList()
00134 throw(CORBA::SystemException)
00135 {
00136 return ptr_ -> emptyTagList();
00137 }
00138
00139 virtual HxCorba::TagList_ptr
00140 simpleIntTag(const char* name,
00141 CORBA::Long val)
00142 throw(CORBA::SystemException)
00143 {
00144 return ptr_ -> simpleIntTag(name, val);
00145 }
00146
00147 virtual HxCorba::TagList_ptr
00148 simpleFloatTag(const char* name,
00149 CORBA::Double val)
00150 throw(CORBA::SystemException)
00151 {
00152 return ptr_ -> simpleFloatTag(name, val);
00153 }
00154
00155 virtual HxCorba::ImageRep_ptr
00156 importImage(HxCorba::ImageData_ptr data)
00157 throw(CORBA::SystemException)
00158 {
00159 return ptr_ -> importImage(data);
00160 }
00161
00162 virtual HxCorba::ImageRep_ptr
00163 fromSignature(HxCorba::ImageSignature sig,
00164 const HxCorba::Sizes& size)
00165 throw(CORBA::SystemException)
00166 {
00167 return ptr_ -> fromSignature(sig, size);
00168 }
00169
00170 virtual HxCorba::ImageRep_ptr
00171 fromImage(HxCorba::ImageSignature sig,
00172 HxCorba::ImageRep_ptr src)
00173 throw(CORBA::SystemException)
00174 {
00175 return ptr_ -> fromImage(sig, src);
00176 }
00177
00178 virtual HxCorba::ImageRep_ptr
00179 fromValue(HxCorba::ImageSignature sig,
00180 const HxCorba::Sizes& size,
00181 const HxCorba::PixValue& val)
00182 throw(CORBA::SystemException)
00183 {
00184 return ptr_ -> fromValue(sig, size, val);
00185 }
00186
00187 virtual HxCorba::ImageRep_ptr
00188 fromByteData(CORBA::Long pixelDimensionality,
00189 CORBA::Long dimensions,
00190 const HxCorba::Sizes& size,
00191 const HxCorba::OctetSeq& data)
00192 throw(CORBA::SystemException)
00193 {
00194 return ptr_ -> fromByteData(pixelDimensionality, dimensions, size, data);
00195 }
00196
00197 virtual HxCorba::ImageRep_ptr
00198 fromShortData(CORBA::Long pixelDimensionality,
00199 CORBA::Long dimensions,
00200 const HxCorba::Sizes& size,
00201 const HxCorba::ShortSeq& data)
00202 throw(CORBA::SystemException)
00203 {
00204 return ptr_ -> fromShortData(pixelDimensionality, dimensions, size, data);
00205 }
00206
00207 virtual HxCorba::ImageRep_ptr
00208 fromIntData(CORBA::Long pixelDimensionality,
00209 CORBA::Long dimensions,
00210 const HxCorba::Sizes& size,
00211 const HxCorba::LongSeq& data)
00212 throw(CORBA::SystemException)
00213 {
00214 return ptr_ -> fromIntData(pixelDimensionality, dimensions, size, data);
00215 }
00216
00217 virtual HxCorba::ImageRep_ptr
00218 fromFloatData(CORBA::Long pixelDimensionality,
00219 CORBA::Long dimensions,
00220 const HxCorba::Sizes& size,
00221 const HxCorba::FloatSeq& data)
00222 throw(CORBA::SystemException)
00223 {
00224 return ptr_ -> fromFloatData(pixelDimensionality, dimensions, size, data);
00225 }
00226
00227 virtual HxCorba::ImageRep_ptr
00228 fromDoubleData(CORBA::Long pixelDimensionality,
00229 CORBA::Long dimensions,
00230 const HxCorba::Sizes& size,
00231 const HxCorba::DoubleSeq& data)
00232 throw(CORBA::SystemException)
00233 {
00234 return ptr_ -> fromDoubleData(pixelDimensionality, dimensions, size, data);
00235 }
00236
00237 virtual HxCorba::ImageRep_ptr
00238 fromJavaRgb(HxCorba::ImageSignature sig,
00239 const HxCorba::Sizes& size,
00240 const HxCorba::RgbSeq& pixels)
00241 throw(CORBA::SystemException)
00242 {
00243 return ptr_ -> fromJavaRgb(sig, size, pixels);
00244 }
00245
00246 virtual HxCorba::ImageRep_ptr
00247 fromGrayValue(HxCorba::ImageSignature sig,
00248 const HxCorba::Sizes& size,
00249 const HxCorba::OctetSeq& pixels)
00250 throw(CORBA::SystemException)
00251 {
00252 return ptr_ -> fromGrayValue(sig, size, pixels);
00253 }
00254
00255 virtual HxCorba::ImageRep_ptr
00256 fromMatlab(HxCorba::ImageSignature sig,
00257 const HxCorba::Sizes& size,
00258 const HxCorba::DoubleSeq& pixels)
00259 throw(CORBA::SystemException)
00260 {
00261 return ptr_ -> fromMatlab(sig, size, pixels);
00262 }
00263
00264 virtual HxCorba::ImageRep_ptr
00265 fromNamedGenerator(HxCorba::ImageSignature sig,
00266 const char* generatorName,
00267 HxCorba::TagList_ptr tags)
00268 throw(CORBA::SystemException)
00269 {
00270 return ptr_ -> fromNamedGenerator(sig, generatorName, tags);
00271 }
00272
00273 virtual HxCorba::ImageRep_ptr
00274 fromImport(HxCorba::ImageSignature sig,
00275 const HxCorba::Sizes& size,
00276 const char* importOp,
00277 HxCorba::TagList_ptr tags)
00278 throw(CORBA::SystemException)
00279 {
00280 return ptr_ -> fromImport(sig, size, importOp, tags);
00281 }
00282
00283 virtual HxCorba::ImageRep_ptr
00284 from2Images(HxCorba::ImageRep_ptr i1,
00285 HxCorba::ImageRep_ptr i2)
00286 throw(CORBA::SystemException)
00287 {
00288 return ptr_ -> from2Images(i1, i2);
00289 }
00290
00291 virtual HxCorba::ImageRep_ptr
00292 from3Images(HxCorba::ImageRep_ptr i1,
00293 HxCorba::ImageRep_ptr i2,
00294 HxCorba::ImageRep_ptr i3)
00295 throw(CORBA::SystemException)
00296 {
00297 return ptr_ -> from3Images(i1, i2, i3);
00298 }
00299
00300 virtual HxCorba::ImageRep_ptr
00301 fromFile(const char* fileName)
00302 throw(CORBA::SystemException)
00303 {
00304 return ptr_ -> fromFile(fileName);
00305 }
00306
00307 virtual HxCorba::SF_ptr
00308 makeSFfromImage(HxCorba::ImageRep_ptr im)
00309 throw(CORBA::SystemException)
00310 {
00311 return ptr_ -> makeSFfromImage(im);
00312 }
00313
00314 virtual HxCorba::SF_ptr
00315 makeFlatSF(HxCorba::ImageSignature sig,
00316 const HxCorba::Sizes& sz,
00317 const HxCorba::PixValue& val)
00318 throw(CORBA::SystemException)
00319 {
00320 return ptr_ -> makeFlatSF(sig, sz, val);
00321 }
00322
00323 virtual HxCorba::SF_ptr
00324 makeBoxSF(HxCorba::ImageSignature sig,
00325 const HxCorba::Sizes& sz,
00326 const HxCorba::PixValue& val)
00327 throw(CORBA::SystemException)
00328 {
00329 return ptr_ -> makeBoxSF(sig, sz, val);
00330 }
00331
00332 virtual HxCorba::SF_ptr
00333 makeCrossSF(HxCorba::ImageSignature sig,
00334 const HxCorba::Sizes& sz,
00335 const HxCorba::PixValue& val)
00336 throw(CORBA::SystemException)
00337 {
00338 return ptr_ -> makeCrossSF(sig, sz, val);
00339 }
00340
00341 virtual HxCorba::SF_ptr
00342 makeDiskSF(HxCorba::ImageSignature sig,
00343 const HxCorba::Sizes& sz,
00344 const HxCorba::PixValue& val)
00345 throw(CORBA::SystemException)
00346 {
00347 return ptr_ -> makeDiskSF(sig, sz, val);
00348 }
00349
00350 virtual HxCorba::SF_ptr
00351 makeDiamondSF(HxCorba::ImageSignature sig,
00352 const HxCorba::Sizes& sz,
00353 const HxCorba::PixValue& val)
00354 throw(CORBA::SystemException)
00355 {
00356 return ptr_ -> makeDiamondSF(sig, sz, val);
00357 }
00358
00359 virtual HxCorba::SF_ptr
00360 makeGaussianSF(const HxCorba::Sizes& sz,
00361 CORBA::Double sigma)
00362 throw(CORBA::SystemException)
00363 {
00364 return ptr_ -> makeGaussianSF(sz, sigma);
00365 }
00366
00367 virtual HxCorba::SF_ptr
00368 makeParabolaSF(const HxCorba::Sizes& sz,
00369 CORBA::Double sigma)
00370 throw(CORBA::SystemException)
00371 {
00372 return ptr_ -> makeParabolaSF(sz, sigma);
00373 }
00374
00375 virtual HxCorba::ImageSeq_ptr
00376 constructImageSeq(const char* name)
00377 throw(CORBA::SystemException)
00378 {
00379 return ptr_ -> constructImageSeq(name);
00380 }
00381
00382 virtual HxCorba::ImageSeq_ptr
00383 constructBufferedImageSeq(const char* name,
00384 CORBA::Long bufSize)
00385 throw(CORBA::SystemException)
00386 {
00387 return ptr_ -> constructBufferedImageSeq(name, bufSize);
00388 }
00389
00390 virtual void
00391 setUseMDC(CORBA::Long flag)
00392 throw(CORBA::SystemException)
00393 {
00394 ptr_ -> setUseMDC(flag);
00395 }
00396
00397 virtual HxCorba::RgbBuffer_ptr
00398 createRgbBuffer(CORBA::Long size)
00399 throw(CORBA::SystemException)
00400 {
00401 return ptr_ -> createRgbBuffer(size);
00402 }
00403
00404 virtual HxCorba::Matrix_ptr
00405 translate2d(CORBA::Double x,
00406 CORBA::Double y)
00407 throw(CORBA::SystemException)
00408 {
00409 return ptr_ -> translate2d(x, y);
00410 }
00411
00412 virtual HxCorba::Matrix_ptr
00413 scale2d(CORBA::Double sx,
00414 CORBA::Double sy)
00415 throw(CORBA::SystemException)
00416 {
00417 return ptr_ -> scale2d(sx, sy);
00418 }
00419
00420 virtual HxCorba::Matrix_ptr
00421 rotate2d(CORBA::Double alpha)
00422 throw(CORBA::SystemException)
00423 {
00424 return ptr_ -> rotate2d(alpha);
00425 }
00426
00427 virtual HxCorba::Matrix_ptr
00428 rotate2dDeg(CORBA::Double alpha)
00429 throw(CORBA::SystemException)
00430 {
00431 return ptr_ -> rotate2dDeg(alpha);
00432 }
00433
00434 virtual HxCorba::Matrix_ptr
00435 reflect2d(CORBA::Boolean doX,
00436 CORBA::Boolean doY)
00437 throw(CORBA::SystemException)
00438 {
00439 return ptr_ -> reflect2d(doX, doY);
00440 }
00441
00442 virtual HxCorba::Matrix_ptr
00443 shear2d(CORBA::Double sx,
00444 CORBA::Double sy)
00445 throw(CORBA::SystemException)
00446 {
00447 return ptr_ -> shear2d(sx, sy);
00448 }
00449
00450 virtual HxCorba::Matrix_ptr
00451 translate3d(CORBA::Double x,
00452 CORBA::Double y,
00453 CORBA::Double z)
00454 throw(CORBA::SystemException)
00455 {
00456 return ptr_ -> translate3d(x, y, z);
00457 }
00458
00459 virtual HxCorba::Matrix_ptr
00460 scale3d(CORBA::Double sx,
00461 CORBA::Double sy,
00462 CORBA::Double sz)
00463 throw(CORBA::SystemException)
00464 {
00465 return ptr_ -> scale3d(sx, sy, sz);
00466 }
00467
00468 virtual HxCorba::Matrix_ptr
00469 rotateX3d(CORBA::Double alpha)
00470 throw(CORBA::SystemException)
00471 {
00472 return ptr_ -> rotateX3d(alpha);
00473 }
00474
00475 virtual HxCorba::Matrix_ptr
00476 rotateX3dDeg(CORBA::Double alpha)
00477 throw(CORBA::SystemException)
00478 {
00479 return ptr_ -> rotateX3dDeg(alpha);
00480 }
00481
00482 virtual HxCorba::Matrix_ptr
00483 rotateY3d(CORBA::Double alpha)
00484 throw(CORBA::SystemException)
00485 {
00486 return ptr_ -> rotateY3d(alpha);
00487 }
00488
00489 virtual HxCorba::Matrix_ptr
00490 rotateY3dDeg(CORBA::Double alpha)
00491 throw(CORBA::SystemException)
00492 {
00493 return ptr_ -> rotateY3dDeg(alpha);
00494 }
00495
00496 virtual HxCorba::Matrix_ptr
00497 rotateZ3d(CORBA::Double alpha)
00498 throw(CORBA::SystemException)
00499 {
00500 return ptr_ -> rotateZ3d(alpha);
00501 }
00502
00503 virtual HxCorba::Matrix_ptr
00504 rotateZ3dDeg(CORBA::Double alpha)
00505 throw(CORBA::SystemException)
00506 {
00507 return ptr_ -> rotateZ3dDeg(alpha);
00508 }
00509
00510 virtual HxCorba::Matrix_ptr
00511 reflect3d(CORBA::Boolean doX,
00512 CORBA::Boolean doY,
00513 CORBA::Boolean doZ)
00514 throw(CORBA::SystemException)
00515 {
00516 return ptr_ -> reflect3d(doX, doY, doZ);
00517 }
00518
00519 virtual HxCorba::Matrix_ptr
00520 projection(CORBA::Double f)
00521 throw(CORBA::SystemException)
00522 {
00523 return ptr_ -> projection(f);
00524 }
00525
00526 virtual HxCorba::Matrix_ptr
00527 camera(CORBA::Double f)
00528 throw(CORBA::SystemException)
00529 {
00530 return ptr_ -> camera(f);
00531 }
00532
00533 virtual HxCorba::Matrix_ptr
00534 lift2dTo3dXY()
00535 throw(CORBA::SystemException)
00536 {
00537 return ptr_ -> lift2dTo3dXY();
00538 }
00539
00540 virtual HxCorba::Histogram_ptr
00541 makeHistogramFromFile(const char* filename)
00542 throw(CORBA::SystemException)
00543 {
00544 return ptr_ -> makeHistogramFromFile(filename);
00545 }
00546
00547 virtual HxCorba::Polyline2d_ptr
00548 importPolyline(HxCorba::Polyline2dData_ptr data)
00549 throw(CORBA::SystemException)
00550 {
00551 return ptr_ -> importPolyline(data);
00552 }
00553
00554 virtual HxCorba::Polyline2d_ptr
00555 createPolyline(const HxCorba::PointR2Seq& points,
00556 CORBA::Boolean closed)
00557 throw(CORBA::SystemException)
00558 {
00559 return ptr_ -> createPolyline(points, closed);
00560 }
00561
00562 virtual HxCorba::BSplineCurve_ptr
00563 makeUniformBSpline(HxCorba::Polyline2d_ptr cp,
00564 CORBA::Long degree)
00565 throw(CORBA::SystemException)
00566 {
00567 return ptr_ -> makeUniformBSpline(cp, degree);
00568 }
00569
00570 virtual HxCorba::BSplineCurve_ptr
00571 makeInterpolatingBSpline(HxCorba::Polyline2d_ptr cp)
00572 throw(CORBA::SystemException)
00573 {
00574 return ptr_ -> makeInterpolatingBSpline(cp);
00575 }
00576
00577 virtual HxCorba::SampledBSplineCurve_ptr
00578 makeUniformSampledBSpline(HxCorba::Polyline2d_ptr cp,
00579 CORBA::Long degree,
00580 CORBA::Double distance)
00581 throw(CORBA::SystemException)
00582 {
00583 return ptr_ -> makeUniformSampledBSpline(cp, degree, distance);
00584 }
00585
00586 virtual HxCorba::SampledBSplineCurve_ptr
00587 makeInterpolatingSampledBSpline(HxCorba::Polyline2d_ptr cp,
00588 CORBA::Double distance)
00589 throw(CORBA::SystemException)
00590 {
00591 return ptr_ -> makeInterpolatingSampledBSpline(cp, distance);
00592 }
00593
00594 virtual HxCorba::NJet_ptr
00595 makeNJet(HxCorba::ImageRep_ptr im,
00596 CORBA::Long N,
00597 CORBA::Double scale,
00598 CORBA::Double precision)
00599 throw(CORBA::SystemException)
00600 {
00601 return ptr_ -> makeNJet(im, N, scale, precision);
00602 }
00603
00604 virtual HxCorba::VxSegmentation_ptr
00605 makeVxSegmentation(const char* filename)
00606 throw(CORBA::SystemException)
00607 {
00608 return ptr_ -> makeVxSegmentation(filename);
00609 }
00610
00611 virtual HxCorba::VxSegmentation_ptr
00612 importSegmentation(HxCorba::VxSegmentation_ptr seg)
00613 throw(CORBA::SystemException)
00614 {
00615 return ptr_ -> importSegmentation(seg);
00616 }
00617
00618 virtual HxCorba::VxStructure_ptr
00619 makeVxStructure(const char* base,
00620 const HxCorba::StringSeq& extLevels)
00621 throw(CORBA::SystemException)
00622 {
00623 return ptr_ -> makeVxStructure(base, extLevels);
00624 }
00625
00626 PortableServer::POA_ptr _default_POA()
00627 {
00628 if(!CORBA::is_nil(poa_))
00629 return PortableServer::POA::_duplicate(poa_);
00630 else
00631 return Constructor::_default_POA();
00632 }
00633 };
00634
00635 }
00636
00637 #endif