00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ___HxCorbaImageSeq_tie_h__
00016 #define ___HxCorbaImageSeq_tie_h__
00017
00018 #include <HxCorbaImageSeq_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 ImageSeqDisplayer_tie : virtual public ImageSeqDisplayer
00041 {
00042 T* ptr_;
00043 PortableServer::POA_ptr poa_;
00044 CORBA::Boolean rel_;
00045
00046 ImageSeqDisplayer_tie(const ImageSeqDisplayer_tie<T>&) { }
00047 void operator=(const ImageSeqDisplayer_tie<T>&) { }
00048
00049 public:
00050
00051 ImageSeqDisplayer_tie(T& t)
00052 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053 {
00054 }
00055
00056 ImageSeqDisplayer_tie(T& t, PortableServer::POA_ptr poa)
00057 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058 {
00059 }
00060
00061 ImageSeqDisplayer_tie(T* p, CORBA::Boolean release = true)
00062 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063 {
00064 }
00065
00066 ImageSeqDisplayer_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 ~ImageSeqDisplayer_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::RgbSeq*
00119 getRgb2d(CORBA::Long frameNr)
00120 throw(CORBA::SystemException)
00121 {
00122 return ptr_ -> getRgb2d(frameNr);
00123 }
00124
00125 virtual void
00126 fillRgb2d(CORBA::Long frameNr,
00127 HxCorba::RgbBuffer_ptr buf)
00128 throw(CORBA::SystemException)
00129 {
00130 ptr_ -> fillRgb2d(frameNr, buf);
00131 }
00132
00133 virtual CORBA::Long
00134 nrFrames()
00135 throw(CORBA::SystemException)
00136 {
00137 return ptr_ -> nrFrames();
00138 }
00139
00140 virtual void
00141 setDisplayMode(const char* displayMode)
00142 throw(CORBA::SystemException)
00143 {
00144 ptr_ -> setDisplayMode(displayMode);
00145 }
00146
00147 virtual char*
00148 getDisplayMode()
00149 throw(CORBA::SystemException)
00150 {
00151 return ptr_ -> getDisplayMode();
00152 }
00153
00154 virtual void
00155 setSize(const HxCorba::Sizes& newSize)
00156 throw(CORBA::SystemException)
00157 {
00158 ptr_ -> setSize(newSize);
00159 }
00160
00161 virtual HxCorba::Sizes
00162 getSizes()
00163 throw(CORBA::SystemException)
00164 {
00165 return ptr_ -> getSizes();
00166 }
00167
00168 virtual HxCorba::Sizes
00169 getOriginalSizes()
00170 throw(CORBA::SystemException)
00171 {
00172 return ptr_ -> getOriginalSizes();
00173 }
00174
00175 virtual void
00176 close()
00177 throw(CORBA::SystemException)
00178 {
00179 ptr_ -> close();
00180 }
00181
00182 PortableServer::POA_ptr _default_POA()
00183 {
00184 if(!CORBA::is_nil(poa_))
00185 return PortableServer::POA::_duplicate(poa_);
00186 else
00187 return ImageSeqDisplayer::_default_POA();
00188 }
00189 };
00190
00191
00192
00193
00194 template<class T>
00195 class ImageSeq_tie : virtual public ImageSeq
00196 {
00197 T* ptr_;
00198 PortableServer::POA_ptr poa_;
00199 CORBA::Boolean rel_;
00200
00201 ImageSeq_tie(const ImageSeq_tie<T>&) { }
00202 void operator=(const ImageSeq_tie<T>&) { }
00203
00204 public:
00205
00206 ImageSeq_tie(T& t)
00207 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00208 {
00209 }
00210
00211 ImageSeq_tie(T& t, PortableServer::POA_ptr poa)
00212 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00213 {
00214 }
00215
00216 ImageSeq_tie(T* p, CORBA::Boolean release = true)
00217 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00218 {
00219 }
00220
00221 ImageSeq_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00222 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00223 {
00224 }
00225
00226 virtual
00227 ~ImageSeq_tie()
00228 {
00229 if(rel_)
00230 delete ptr_;
00231
00232 CORBA::release(poa_);
00233 }
00234
00235 T*
00236 _tied_object()
00237 {
00238 return ptr_;
00239 }
00240
00241 void
00242 _tied_object(T& obj)
00243 {
00244 if(rel_)
00245 delete ptr_;
00246
00247 ptr_ = &obj;
00248 rel_ = false;
00249 }
00250
00251 void
00252 _tied_object(T* obj, CORBA::Boolean release = true)
00253 {
00254 if(rel_)
00255 delete ptr_;
00256
00257 ptr_ = obj;
00258 rel_ = release;
00259 }
00260
00261 CORBA::Boolean
00262 _is_owner()
00263 {
00264 return rel_;
00265 }
00266
00267 void
00268 _is_owner(CORBA::Boolean b)
00269 {
00270 rel_ = b;
00271 }
00272
00273 virtual HxCorba::ImageRep_ptr
00274 getFrame(CORBA::Long frameNr)
00275 throw(CORBA::SystemException)
00276 {
00277 return ptr_ -> getFrame(frameNr);
00278 }
00279
00280 virtual CORBA::Long
00281 nrFrames()
00282 throw(CORBA::SystemException)
00283 {
00284 return ptr_ -> nrFrames();
00285 }
00286
00287 virtual HxCorba::Sizes
00288 frameSizes()
00289 throw(CORBA::SystemException)
00290 {
00291 return ptr_ -> frameSizes();
00292 }
00293
00294 virtual HxCorba::RgbSeq*
00295 getRgb2d(CORBA::Long frameNr,
00296 const char* displayMode)
00297 throw(CORBA::SystemException)
00298 {
00299 return ptr_ -> getRgb2d(frameNr, displayMode);
00300 }
00301
00302 virtual void
00303 fillRgb2d(CORBA::Long frameNr,
00304 HxCorba::RgbBuffer_ptr buf,
00305 const char* displayMode)
00306 throw(CORBA::SystemException)
00307 {
00308 ptr_ -> fillRgb2d(frameNr, buf, displayMode);
00309 }
00310
00311 virtual HxCorba::ImageSeqDisplayer_ptr
00312 getDisplayer()
00313 throw(CORBA::SystemException)
00314 {
00315 return ptr_ -> getDisplayer();
00316 }
00317
00318 virtual HxCorba::VxSegmentation_ptr
00319 findCuts(HxCorba::TagList_ptr tags)
00320 throw(CORBA::SystemException)
00321 {
00322 return ptr_ -> findCuts(tags);
00323 }
00324
00325 virtual void
00326 destroy()
00327 throw(CORBA::SystemException)
00328 {
00329 ptr_ -> destroy();
00330 }
00331
00332 PortableServer::POA_ptr _default_POA()
00333 {
00334 if(!CORBA::is_nil(poa_))
00335 return PortableServer::POA::_duplicate(poa_);
00336 else
00337 return ImageSeq::_default_POA();
00338 }
00339 };
00340
00341
00342
00343
00344 template<class T>
00345 class ImageSeqFactory_tie : virtual public ImageSeqFactory
00346 {
00347 T* ptr_;
00348 PortableServer::POA_ptr poa_;
00349 CORBA::Boolean rel_;
00350
00351 ImageSeqFactory_tie(const ImageSeqFactory_tie<T>&) { }
00352 void operator=(const ImageSeqFactory_tie<T>&) { }
00353
00354 public:
00355
00356 ImageSeqFactory_tie(T& t)
00357 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00358 {
00359 }
00360
00361 ImageSeqFactory_tie(T& t, PortableServer::POA_ptr poa)
00362 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00363 {
00364 }
00365
00366 ImageSeqFactory_tie(T* p, CORBA::Boolean release = true)
00367 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00368 {
00369 }
00370
00371 ImageSeqFactory_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00372 : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00373 {
00374 }
00375
00376 virtual
00377 ~ImageSeqFactory_tie()
00378 {
00379 if(rel_)
00380 delete ptr_;
00381
00382 CORBA::release(poa_);
00383 }
00384
00385 T*
00386 _tied_object()
00387 {
00388 return ptr_;
00389 }
00390
00391 void
00392 _tied_object(T& obj)
00393 {
00394 if(rel_)
00395 delete ptr_;
00396
00397 ptr_ = &obj;
00398 rel_ = false;
00399 }
00400
00401 void
00402 _tied_object(T* obj, CORBA::Boolean release = true)
00403 {
00404 if(rel_)
00405 delete ptr_;
00406
00407 ptr_ = obj;
00408 rel_ = release;
00409 }
00410
00411 CORBA::Boolean
00412 _is_owner()
00413 {
00414 return rel_;
00415 }
00416
00417 void
00418 _is_owner(CORBA::Boolean b)
00419 {
00420 rel_ = b;
00421 }
00422
00423 virtual HxCorba::ImageSeq_ptr
00424 constructImageSeq(const char* name)
00425 throw(CORBA::SystemException)
00426 {
00427 return ptr_ -> constructImageSeq(name);
00428 }
00429
00430 virtual HxCorba::ImageSeq_ptr
00431 constructBufferedImageSeq(const char* name,
00432 CORBA::Long bufSize)
00433 throw(CORBA::SystemException)
00434 {
00435 return ptr_ -> constructBufferedImageSeq(name, bufSize);
00436 }
00437
00438 virtual void
00439 setUseMDC(CORBA::Long flag)
00440 throw(CORBA::SystemException)
00441 {
00442 ptr_ -> setUseMDC(flag);
00443 }
00444
00445 PortableServer::POA_ptr _default_POA()
00446 {
00447 if(!CORBA::is_nil(poa_))
00448 return PortableServer::POA::_duplicate(poa_);
00449 else
00450 return ImageSeqFactory::_default_POA();
00451 }
00452 };
00453
00454 }
00455
00456 #endif