00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ___HxCorbaUserOps_tie_h__
00016 #define ___HxCorbaUserOps_tie_h__
00017
00018 #include <HxCorbaUserOps_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 UserOps_tie : virtual public UserOps
00041 {
00042 T* ptr_;
00043 PortableServer::POA_ptr poa_;
00044 CORBA::Boolean rel_;
00045
00046 UserOps_tie(const UserOps_tie<T>&) { }
00047 void operator=(const UserOps_tie<T>&) { }
00048
00049 public:
00050
00051 UserOps_tie(T& t)
00052 : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053 {
00054 }
00055
00056 UserOps_tie(T& t, PortableServer::POA_ptr poa)
00057 : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058 {
00059 }
00060
00061 UserOps_tie(T* p, CORBA::Boolean release = true)
00062 : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063 {
00064 }
00065
00066 UserOps_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 ~UserOps_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 void
00119 HxOpenTrecDB(const char* indexFile,
00120 const char* dbDir)
00121 throw(CORBA::SystemException)
00122 {
00123 ptr_ -> HxOpenTrecDB(indexFile, dbDir);
00124 }
00125
00126 virtual HxCorba::SegmentQueryResultSeq*
00127 HxTrecDemo(HxCorba::TrecFaceT faces,
00128 HxCorba::TrecYesNoT monologue,
00129 HxCorba::TrecYesNoT speech,
00130 HxCorba::TrecCameraT camera,
00131 HxCorba::ImageRep_ptr qimage)
00132 throw(CORBA::SystemException)
00133 {
00134 return ptr_ -> HxTrecDemo(faces, monologue, speech, camera, qimage);
00135 }
00136
00137 virtual void
00138 HxInitTrack(HxCorba::ImageSeq_ptr seq,
00139 CORBA::Long startFrame,
00140 CORBA::Long x0,
00141 CORBA::Long y0,
00142 CORBA::Long x1,
00143 CORBA::Long y1)
00144 throw(CORBA::SystemException)
00145 {
00146 ptr_ -> HxInitTrack(seq, startFrame, x0, y0, x1, y1);
00147 }
00148
00149 virtual CORBA::Boolean
00150 HxDoTrack(CORBA::Long nextFrame,
00151 CORBA::Long_out x0,
00152 CORBA::Long_out y0,
00153 CORBA::Long_out x1,
00154 CORBA::Long_out y1,
00155 CORBA::Boolean_out occlusion)
00156 throw(CORBA::SystemException)
00157 {
00158 return ptr_ -> HxDoTrack(nextFrame, x0, y0, x1, y1, occlusion);
00159 }
00160
00161 virtual void
00162 HxEndTrack()
00163 throw(CORBA::SystemException)
00164 {
00165 ptr_ -> HxEndTrack();
00166 }
00167
00168 virtual char*
00169 MyStringFunction()
00170 throw(CORBA::SystemException)
00171 {
00172 return ptr_ -> MyStringFunction();
00173 }
00174
00175 virtual HxCorba::MyMessage*
00176 MyStringFunction2()
00177 throw(CORBA::SystemException)
00178 {
00179 return ptr_ -> MyStringFunction2();
00180 }
00181
00182 virtual HxCorba::AapFeatures
00183 JmCalcAapFeatures(HxCorba::ImageRep_ptr aap,
00184 HxCorba::ImageRep_ptr aapSegmentation)
00185 throw(CORBA::SystemException)
00186 {
00187 return ptr_ -> JmCalcAapFeatures(aap, aapSegmentation);
00188 }
00189
00190 PortableServer::POA_ptr _default_POA()
00191 {
00192 if(!CORBA::is_nil(poa_))
00193 return PortableServer::POA::_duplicate(poa_);
00194 else
00195 return UserOps::_default_POA();
00196 }
00197 };
00198
00199 }
00200
00201 #endif