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

CSimpleConnectionManager.hpp

Go to the documentation of this file.
00001 
00002 #ifndef CSimpleConnectionManager_h
00003 #define CSimpleConnectionManager_h 1
00004 
00005 #include "jic/include/bdlib.hpp"
00006 #include "jic/include/standard_stl.hpp"
00007 
00008 #include <ace/Singleton.h>
00009 
00010 namespace BD {
00011 
00012   typedef std::list<OCICPP::Connection *> ListConnection;
00013 
00014   class CSimpleConnectionManager 
00015   {
00016 
00017     public:
00018         CSimpleConnectionManager();
00019 
00020         ~CSimpleConnectionManager();
00021 
00022         OCICPP::Connection * getConnection ();
00023 
00024         void freeConnection (OCICPP::Connection *connection);
00025 
00026       // Additional Public Declarations
00027 
00028     protected:
00029       // Additional Protected Declarations
00030 
00031     private:
00032         CSimpleConnectionManager(const CSimpleConnectionManager &right);
00033 
00034         CSimpleConnectionManager & operator=(const CSimpleConnectionManager &right);
00035 
00036         //      Leer la configuración
00037         void readConfig ();
00038 
00039       // Additional Private Declarations
00040 
00041     private: 
00042       // Data Members for Class Attributes
00043 
00044         int m_iNumConnections;
00045 
00046         std::string m_strTnsName;
00047 
00048         std::string m_strUser;
00049 
00050         std::string m_strPassword;
00051 
00052       // Data Members for Associations
00053 
00054         ListConnection m_freeConnections;
00055 
00056       // Additional Implementation Declarations
00057 
00058   };
00059 
00060   
00061   
00062    typedef ACE_Unmanaged_Singleton<CSimpleConnectionManager, ACE_SYNCH_MUTEX> SimpleConnectionManager;
00063      // Defininición para crear un objeto singleton en entorno MT.
00064      // Si estamos un un entorno no MT y queremos evitar el coste de los
00065      // mutex, se podría parametrizar en lugar de con ACE_SYNC_MUTEX con
00066      // ACE_SYNC_NULL_MUTEX.
00067      // Nota: Usando el ACE_Singleton, ElectricFence me daba un mensaje de que una
00068      //       llamada a mmap habia fallado (supongo que cuando destruyendo el puntero)
00069   
00070 
00071   // Class BD::CSimpleConnectionManager 
00072 
00073   inline CSimpleConnectionManager::CSimpleConnectionManager(const CSimpleConnectionManager &right)
00074   {
00075   }
00076 
00077   inline CSimpleConnectionManager & CSimpleConnectionManager::operator=(const CSimpleConnectionManager &right)
00078   {
00079     return *this;
00080   }
00081 
00082 } // namespace BD
00083 
00084 #endif

Generated on Wed Mar 5 21:31:47 2003 for JIC by doxygen1.3-rc3