Horus Doc || IDL Reference || C++ Binding   Java Binding || Doxygen's quick Index  

HxCorbaDatabase_skel_tie.h

Go to the documentation of this file.
00001 // **********************************************************************
00002 //
00003 // Generated by the ORBacus IDL-to-C++ Translator
00004 //
00005 // Copyright (c) 2001
00006 // IONA Technologies, Inc.
00007 // Waltham, MA, USA
00008 //
00009 // All Rights Reserved
00010 //
00011 // **********************************************************************
00012 
00013 // Version: 4.1.0
00014 
00015 #ifndef ___HxCorbaDatabase_tie_h__
00016 #define ___HxCorbaDatabase_tie_h__
00017 
00018 #include <HxCorbaDatabase_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 // IDL:HxCorba:1.0
00032 //
00033 namespace POA_HxCorba
00034 {
00035 
00036 //
00037 // IDL:HxCorba/DatabaseSession:1.0
00038 //
00039 template<class T>
00040 class DatabaseSession_tie : virtual public DatabaseSession
00041 {
00042     T* ptr_;
00043     PortableServer::POA_ptr poa_;
00044     CORBA::Boolean rel_;
00045 
00046     DatabaseSession_tie(const DatabaseSession_tie<T>&) { }
00047     void operator=(const DatabaseSession_tie<T>&) { }
00048 
00049 public:
00050 
00051     DatabaseSession_tie(T& t)
00052         : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053     {
00054     }
00055 
00056     DatabaseSession_tie(T& t, PortableServer::POA_ptr poa)
00057         : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058     {
00059     }
00060 
00061     DatabaseSession_tie(T* p, CORBA::Boolean release = true)
00062         : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063     {
00064     }
00065 
00066     DatabaseSession_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     ~DatabaseSession_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::StringSeq*
00119     listVideos()
00120         throw(CORBA::SystemException)
00121     {
00122         return ptr_ -> listVideos();
00123     }
00124 
00125     virtual HxCorba::StringSeq*
00126     listSegmentations(const char* videoName)
00127         throw(CORBA::SystemException)
00128     {
00129         return ptr_ -> listSegmentations(videoName);
00130     }
00131 
00132     virtual HxCorba::VxSegmentation_ptr
00133     getSegmentation(const char* videoName,
00134                     const char* segName)
00135         throw(CORBA::SystemException)
00136     {
00137         return ptr_ -> getSegmentation(videoName, segName);
00138     }
00139 
00140     virtual HxCorba::VxSegmentSeq*
00141     querySegments(const char* sqlQuery)
00142         throw(HxCorba::DatabaseException,
00143               CORBA::SystemException)
00144     {
00145         return ptr_ -> querySegments(sqlQuery);
00146     }
00147 
00148     virtual HxCorba::StringSeq*
00149     queryStrings(const char* sqlQuery)
00150         throw(HxCorba::DatabaseException,
00151               CORBA::SystemException)
00152     {
00153         return ptr_ -> queryStrings(sqlQuery);
00154     }
00155 
00156     virtual HxCorba::SegmentQueryResultSeq*
00157     queryMultipleSegments(const char* sqlQuery)
00158         throw(HxCorba::DatabaseException,
00159               CORBA::SystemException)
00160     {
00161         return ptr_ -> queryMultipleSegments(sqlQuery);
00162     }
00163 
00164     virtual void
00165     close()
00166         throw(CORBA::SystemException)
00167     {
00168         ptr_ -> close();
00169     }
00170 
00171     PortableServer::POA_ptr _default_POA()
00172     {
00173         if(!CORBA::is_nil(poa_))
00174             return PortableServer::POA::_duplicate(poa_);
00175         else
00176             return DatabaseSession::_default_POA();
00177     }
00178 };
00179 
00180 //
00181 // IDL:HxCorba/Database:1.0
00182 //
00183 template<class T>
00184 class Database_tie : virtual public Database
00185 {
00186     T* ptr_;
00187     PortableServer::POA_ptr poa_;
00188     CORBA::Boolean rel_;
00189 
00190     Database_tie(const Database_tie<T>&) { }
00191     void operator=(const Database_tie<T>&) { }
00192 
00193 public:
00194 
00195     Database_tie(T& t)
00196         : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00197     {
00198     }
00199 
00200     Database_tie(T& t, PortableServer::POA_ptr poa)
00201         : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00202     {
00203     }
00204 
00205     Database_tie(T* p, CORBA::Boolean release = true)
00206         : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00207     {
00208     }
00209 
00210     Database_tie(T* p, PortableServer::POA_ptr poa, CORBA::Boolean release = true)
00211         : ptr_(p), poa_(PortableServer::POA::_duplicate(poa)), rel_(release)
00212     {
00213     }
00214 
00215     virtual
00216     ~Database_tie()
00217     {
00218         if(rel_)
00219             delete ptr_;
00220 
00221         CORBA::release(poa_);
00222     }
00223 
00224     T*
00225     _tied_object()
00226     {
00227         return ptr_;
00228     }
00229 
00230     void
00231     _tied_object(T& obj)
00232     {
00233         if(rel_)
00234             delete ptr_;
00235 
00236         ptr_ = &obj;
00237         rel_ = false;
00238     }
00239 
00240     void
00241     _tied_object(T* obj, CORBA::Boolean release = true)
00242     {
00243         if(rel_)
00244             delete ptr_;
00245 
00246         ptr_ = obj;
00247         rel_ = release;
00248     }
00249 
00250     CORBA::Boolean
00251     _is_owner()
00252     {
00253         return rel_;
00254     }
00255 
00256     void
00257     _is_owner(CORBA::Boolean b)
00258     {
00259         rel_ = b;
00260     }
00261 
00262     virtual HxCorba::DatabaseSession_ptr
00263     openSession(const char* username,
00264                 const char* password)
00265         throw(HxCorba::DatabaseException,
00266               CORBA::SystemException)
00267     {
00268         return ptr_ -> openSession(username, password);
00269     }
00270 
00271     PortableServer::POA_ptr _default_POA()
00272     {
00273         if(!CORBA::is_nil(poa_))
00274             return PortableServer::POA::_duplicate(poa_);
00275         else
00276             return Database::_default_POA();
00277     }
00278 };
00279 
00280 } // End of namespace POA_HxCorba
00281 
00282 #endif

Generated on Tue Feb 3 14:15:49 2004 for C++Binding by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001