| # Gaudi Framework, version v20r3
Generated: 24 Nov 2008

# IODataManager.h

Go to the documentation of this file.

    00001 #ifndef GAUDIUTILS_IODATAMANAGER_H
    00002 #define GAUDIUTILS_IODATAMANAGER_H
    00003
    00004 // C++ include files
    00005 #include <map>
    00006 // Framework include files
    00007 #include "GaudiKernel/Service.h"
    00008 #include "GaudiUtils/IIODataManager.h"
    00009
    00010 /*
    00011  *  LHCb namespace declaration
    00012  */
    00013 namespace Gaudi  {
    00014
    00015   // Forward declarations
    00016   class IFileCatalog;
    00017   class RawDataConnectionEntry;
    00018
    00025   class IODataManager : virtual public IIODataManager, public Service  {
    00026   protected:
    00027     typedef const std::string& CSTR;
    00028     struct Entry  {
    00029       std::string      type;
    00030       IoType           ioType;
    00031       IDataConnection* connection;
    00032       bool             keepOpen;
    00033       Entry(CSTR tech,bool k, IoType iot,IDataConnection* con)
    00034       : type(tech), ioType(iot), connection(con), keepOpen(k) {
    00035       }
    00036     };
    00037     typedef std::map<std::string,Entry*>       ConnectionMap;
    00038     typedef std::map<std::string, std::string> FidMap;
    00039
    00041     std::string          m_catalogSvcName;
    00043     int                  m_ageLimit;
    00045     bool                 m_useGFAL;
    00047     bool                 m_quarantine;
    00048
    00050     ConnectionMap        m_connectionMap;
    00052     IFileCatalog*        m_catalog;
    00054     FidMap               m_fidMap;
    00055     StatusCode connectDataIO(int typ, IoType rw, CSTR fn, CSTR technology, bool keep,Connection* con);
    00056     StatusCode reconnect(Entry* e);
    00057     StatusCode error(CSTR msg, bool rethrow);
    00058     StatusCode establishConnection(Connection* con);
    00059   public:
    00060
    00066     IODataManager(CSTR nam, ISvcLocator* loc);
    00067
    00069     virtual ~IODataManager()  {}
    00070
    00072     virtual StatusCode initialize();
    00073
    00075     virtual StatusCode finalize();
    00076
    00077     // IInterface implementation: query interfaces
    00078     virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
    00079
    00081     virtual StatusCode connectRead(bool keep_open, Connection* ioDesc);
    00083     virtual StatusCode connectWrite(Connection* con,IoType mode=Connection::CREATE,CSTR doctype="UNKNOWN");
    00085     virtual StatusCode disconnect(Connection* ioDesc);
    00087     virtual Connection* connection(const std::string& dsn) const;
    00089     virtual Connections connections(const IInterface* owner) const;
    00091     virtual StatusCode read(Connection* ioDesc, void* const data, size_t len);
    00093     virtual StatusCode write(Connection* con, const void* data, int len);
    00095     virtual long long int seek(Connection* ioDesc, long long int where, int origin);
    00096   };
    00097 }         // End namespace Gaudi
    00098 #endif    // GAUDIUTILS_IODATAMANAGER_H