Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

DLL_ORB.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     DLL_ORB.h
00006  *
00007  *  $Id: DLL_ORB.h,v 1.1.1.2 2003/02/21 18:36:44 chad Exp $
00008  *
00009  *  Header file for the TAO_DLL_ORB helper class.
00010  *
00011  *
00012  *  @author  Ossama Othman <ossama@uci.edu>
00013  */
00014 //=============================================================================
00015 
00016 
00017 #ifndef TAO_DLL_ORB_H
00018 #define TAO_DLL_ORB_H
00019 
00020 #include "ace/pre.h"
00021 
00022 #include "ace/Task.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #include "ace/Service_Config.h"
00029 #include "tao/ORB.h"
00030 
00031 /**
00032  * @class TAO_DLL_ORB
00033  *
00034  * @brief Helper class that initializes an ORB when an instance of
00035  *        this class is dynamically loaded.
00036  *
00037  * This class is deprecated.  While it does demonstrate how to
00038  * initialize an ORB in a dynamically loaded object, the fact that it
00039  * is located in the TAO library forces the TAO library to be linked
00040  * to the application binary.  This prevents TAO from being completely
00041  * decoupled from an application when dynamic loading is used, hence
00042  * defeating the purpose of dynamically loading the object!
00043  * @par
00044  * For an example of how to dynamically load an ORB (actually initialize
00045  * an ORB inside a dynamically loaded object) that is completely
00046  * decoupled from an application binary see the TAO/tests/DLL_ORB
00047  * test.
00048  */
00049 class TAO_Export TAO_DLL_ORB : public ACE_Task_Base
00050 {
00051 
00052 public:
00053 
00054   /// Constructor
00055   TAO_DLL_ORB (void);
00056 
00057   /// Destructor
00058   ~TAO_DLL_ORB (void);
00059 
00060   /// Initializes ORB when dynamic linking occurs.
00061   virtual int init (int argc, ACE_TCHAR *argv[]);
00062 
00063   /// Terminates ORB when dynamic unlinking occurs.
00064   virtual int fini (void);
00065 
00066   /// Run by a daemon thread to handle deferred processing.
00067   virtual int svc (void);
00068 
00069   /// Returns a duplicate reference to the ORB.
00070   CORBA::ORB_ptr orb (void);
00071 
00072 private:
00073 
00074   /// Reference to the ORB.
00075   CORBA::ORB_var orb_;
00076 
00077 };
00078 
00079 #if defined (__ACE_INLINE__)
00080 # include "tao/DLL_ORB.inl"
00081 #endif  /* ! __ACE_INLINE__ */
00082 
00083 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_DLL_ORB)
00084 ACE_FACTORY_DECLARE (TAO, TAO_DLL_ORB)
00085 
00086 #include "ace/post.h"
00087 
00088 #endif  /* TAO_DLL_ORB_H */

Generated on Mon Jun 16 13:48:14 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002