| # Gaudi Framework, version v21r6 |

Home |  | Generated: 11 Nov 2009

# PoolDbDataConnection.h

Go to the documentation of this file.

    00001 // $Id: PoolDbDataConnection.h,v 1.2 2008/01/30 13:49:09 marcocle Exp $
    00002 //====================================================================
    00003 //      PoolDbDataConnection.h
    00004 //--------------------------------------------------------------------
    00005 //
    00006 //      Author     : M.Frank
    00007 //====================================================================
    00008 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiPoolDb/GaudiPoolDb/PoolDbDataConnection.h,v 1.2 2008/01/30 13:49:09 marcocle Exp $
    00009 #ifndef GAUDIPOOLDB_POOLDBDATACONNECTION_H
    00010 #define GAUDIPOOLDB_POOLDBDATACONNECTION_H
    00011
    00012 // Framework include files
    00013 #include "GaudiUtils/IIODataManager.h"
    00014 #include "StorageSvc/DbDomain.h"
    00015 #include "StorageSvc/DbDatabase.h"
    00016 #include "StorageSvc/DbTransaction.h"
    00017
    00029 class GAUDI_API PoolDbDataConnection: virtual public Gaudi::IDataConnection  {
    00030 protected:
    00031   int                 m_type;
    00033   int                 m_mode;
    00035   pool::DbTransaction m_transaction;
    00037   pool::DbDatabase    m_dbH;
    00039   pool::DbDomain      m_domH;
    00040
    00042   virtual StatusCode i_connect();
    00043 public:
    00045   PoolDbDataConnection(IInterface* owner, const std::string& nam, int typ, int mode, pool::DbDomain& domH);
    00047   virtual ~PoolDbDataConnection();
    00049   pool::DbDatabase& database()            {     return m_dbH;                }
    00051   pool::DbTransaction& transaction()      {     return m_transaction;        }
    00053   virtual bool isConnected() const        {     return m_dbH.ptr() != 0;     }
    00055   virtual StatusCode connectRead()        {     return i_connect();          }
    00057   virtual StatusCode connectWrite(IoType /* typ */)  {return i_connect();    }
    00059   virtual StatusCode disconnect();
    00061   virtual StatusCode read(void* const /* data */, size_t /* len */)
    00062   {  return StatusCode::FAILURE;                                             }
    00064   virtual StatusCode write(const void* /* data */, int /* len */ )
    00065   {  return StatusCode::FAILURE;                                             }
    00067   virtual long long int seek(long long int /* where */, int /* origin */)
    00068   {  return -1;                                                              }
    00069 };
    00070 #endif    // GAUDIPOOLDB_POOLDBDATACONNECTION_H