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

HxCorbaApp_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 ___HxCorbaApp_tie_h__
00016 #define ___HxCorbaApp_tie_h__
00017 
00018 #include <HxCorbaApp_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/App:1.0
00038 //
00039 template<class T>
00040 class App_tie : virtual public App
00041 {
00042     T* ptr_;
00043     PortableServer::POA_ptr poa_;
00044     CORBA::Boolean rel_;
00045 
00046     App_tie(const App_tie<T>&) { }
00047     void operator=(const App_tie<T>&) { }
00048 
00049 public:
00050 
00051     App_tie(T& t)
00052         : ptr_(&t), poa_(PortableServer::POA::_nil()), rel_(false)
00053     {
00054     }
00055 
00056     App_tie(T& t, PortableServer::POA_ptr poa)
00057         : ptr_(&t), poa_(PortableServer::POA::_duplicate(poa)), rel_(false)
00058     {
00059     }
00060 
00061     App_tie(T* p, CORBA::Boolean release = true)
00062         : ptr_(p), poa_(PortableServer::POA::_nil()), rel_(release)
00063     {
00064     }
00065 
00066     App_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     ~App_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     listObjectTypes(HxCorba::StringSeq_out sl)
00120         throw(CORBA::SystemException)
00121     {
00122         ptr_ -> listObjectTypes(sl);
00123     }
00124 
00125     virtual void
00126     listObjects(const char* typeId,
00127                 HxCorba::StringSeq_out sl)
00128         throw(CORBA::SystemException)
00129     {
00130         ptr_ -> listObjects(typeId, sl);
00131     }
00132 
00133     virtual CORBA::Object_ptr
00134     getObject(const char* typeId,
00135               const char* name)
00136         throw(CORBA::SystemException)
00137     {
00138         return ptr_ -> getObject(typeId, name);
00139     }
00140 
00141     virtual CORBA::Boolean
00142     putObject(const char* typeId,
00143               const char* name,
00144               CORBA::Object_ptr obj)
00145         throw(CORBA::SystemException)
00146     {
00147         return ptr_ -> putObject(typeId, name, obj);
00148     }
00149 
00150     virtual void
00151     listImages(HxCorba::StringSeq_out sl)
00152         throw(CORBA::SystemException)
00153     {
00154         ptr_ -> listImages(sl);
00155     }
00156 
00157     virtual HxCorba::ImageRep_ptr
00158     getImage(const char* name)
00159         throw(CORBA::SystemException)
00160     {
00161         return ptr_ -> getImage(name);
00162     }
00163 
00164     virtual CORBA::Boolean
00165     putImage(const char* name,
00166              HxCorba::ImageRep_ptr img)
00167         throw(CORBA::SystemException)
00168     {
00169         return ptr_ -> putImage(name, img);
00170     }
00171 
00172     PortableServer::POA_ptr _default_POA()
00173     {
00174         if(!CORBA::is_nil(poa_))
00175             return PortableServer::POA::_duplicate(poa_);
00176         else
00177             return App::_default_POA();
00178     }
00179 };
00180 
00181 } // End of namespace POA_HxCorba
00182 
00183 #endif

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