ATLAS Offline Software
IPoolSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef POOLSVC_IPOOLSVC_H
6 #define POOLSVC_IPOOLSVC_H
7 
13 #include "GaudiKernel/IService.h"
16 #include "DataModelRoot/RootType.h"
17 
18 #include <string>
19 
20 // Forward declarations
21 namespace pool {
22  class IFileCatalog;
23 }
24 namespace coral {
25  class Context;
26 }
27 class Placement;
28 class StatusCode;
29 class Token;
30 
31 static const InterfaceID IID_IPoolSvc("IPoolSvc", 1, 0);
32 
36 class IPoolSvc : virtual public IService {
37 
38 public: // static members
41 
42 public: // Non-static members
44  static const InterfaceID& interfaceID() { return(IID_IPoolSvc); }
45 
50  virtual Token* registerForWrite(const Placement* placement,
51  const void* obj,
52  const RootType& classDesc) = 0;
53 
57  virtual void setObjPtr(void*& obj, const Token* token) = 0;
58 
61  virtual unsigned int getOutputContext(const std::string& label) = 0;
62 
66  virtual unsigned int getInputContext(const std::string& label, unsigned int maxFile = 0) = 0;
67 
69  virtual const std::map<std::string, unsigned int>& getInputContextMap() const = 0;
70 
72  virtual const coral::Context* context() const = 0;
73 
76  virtual void loadComponent(const std::string& compName) = 0;
77 
80  virtual void setShareMode(bool shareCat) = 0;
81 
83  virtual const pool::IFileCatalog* catalog() const = 0;
84 
89  virtual void lookupBestPfn(const std::string& token, std::string& pfn, std::string& type) const = 0;
90 
94  virtual void renamePfn(const std::string& pf, const std::string& newpf) = 0;
95 
101  virtual pool::ICollection* createCollection(const std::string& collectionType,
102  const std::string& connection,
103  const std::string& collectionName,
104  unsigned int contextId = IPoolSvc::kInputStream) const = 0;
105 
110  virtual Token* getToken(const std::string& connection,
111  const std::string& collection,
112  const unsigned long ientry) const = 0;
113 
116  unsigned int contextId = IPoolSvc::kInputStream) = 0;
117 
120  virtual StatusCode commit(unsigned int contextId = IPoolSvc::kInputStream) const = 0;
121 
124  virtual StatusCode commitAndHold(unsigned int contextId = IPoolSvc::kInputStream) const = 0;
125 
128  virtual StatusCode disconnect(unsigned int contextId = IPoolSvc::kInputStream) const = 0;
129 
133  virtual StatusCode disconnectDb(const std::string& connection,
134  unsigned int contextId = IPoolSvc::kInputStream) const = 0;
135 
137  virtual long long int getFileSize(const std::string& dbName, long tech, unsigned int contextId) const = 0;
138 
140  virtual StatusCode getAttribute(const std::string& optName,
141  std::string& data,
142  long tech,
143  unsigned int contextId = IPoolSvc::kInputStream) const = 0;
144 
146  virtual StatusCode getAttribute(const std::string& optName,
147  std::string& data,
148  long tech,
149  const std::string& dbName,
150  const std::string& contName = "",
151  unsigned int contextId = IPoolSvc::kInputStream) const = 0;
152 
154  virtual StatusCode setAttribute(const std::string& optName,
155  const std::string& data,
156  long tech,
157  unsigned int contextId = IPoolSvc::kOutputStream) const = 0;
158 
160  virtual StatusCode setAttribute(const std::string& optName,
161  const std::string& data,
162  long tech,
163  const std::string& dbName,
164  const std::string& contName = "",
165  unsigned int contextId = IPoolSvc::kOutputStream) const = 0;
166 
168  virtual StatusCode setFrontierCache(const std::string& conn) = 0;
169 };
170 
171 #endif
IPoolSvc::registerForWrite
virtual Token * registerForWrite(const Placement *placement, const void *obj, const RootType &classDesc)=0
IPoolSvc::getInputContextMap
virtual const std::map< std::string, unsigned int > & getInputContextMap() const =0
IPoolSvc::kOutputStream
@ kOutputStream
Definition: IPoolSvc.h:40
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
AddEmptyComponent.compName
compName
Definition: AddEmptyComponent.py:32
Placement
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition: Placement.h:19
IPoolSvc
This class provides the interface to the LCG POOL persistency software.
Definition: IPoolSvc.h:36
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
IPoolSvc::getToken
virtual Token * getToken(const std::string &connection, const std::string &collection, const unsigned long ientry) const =0
IPoolSvc::getAttribute
virtual StatusCode getAttribute(const std::string &optName, std::string &data, long tech, unsigned int contextId=IPoolSvc::kInputStream) const =0
Get POOL attributes - domain.
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
pool
pool namespace
Definition: libname.h:15
IPoolSvc::renamePfn
virtual void renamePfn(const std::string &pf, const std::string &newpf)=0
ITransaction.h
IPoolSvc::setFrontierCache
virtual StatusCode setFrontierCache(const std::string &conn)=0
Setup Frontier cache for given logical or physical connection name.
IPoolSvc::commitAndHold
virtual StatusCode commitAndHold(unsigned int contextId=IPoolSvc::kInputStream) const =0
Commit data for a given stream and hold buffer.
pool::ITransaction::Type
Type
Transaction type enumeration.
Definition: ITransaction.h:28
IPoolSvc::getOutputContext
virtual unsigned int getOutputContext(const std::string &label)=0
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
IPoolSvc::interfaceID
static const InterfaceID & interfaceID()
Retrieve interface ID.
Definition: IPoolSvc.h:44
coral
Definition: ISecondaryEventSelector.h:19
IPoolSvc::kInputStream
@ kInputStream
Definition: IPoolSvc.h:40
IPoolSvc::setObjPtr
virtual void setObjPtr(void *&obj, const Token *token)=0
pool::IFileCatalog
Definition: IFileCatalog.h:23
IPoolSvc::commit
virtual StatusCode commit(unsigned int contextId=IPoolSvc::kInputStream) const =0
Commit data for a given stream and flush buffer.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PixelModuleFeMask_create_db.dbName
string dbName
Definition: PixelModuleFeMask_create_db.py:21
ICollection.h
IPoolSvc::lookupBestPfn
virtual void lookupBestPfn(const std::string &token, std::string &pfn, std::string &type) const =0
IPoolSvc::catalog
virtual const pool::IFileCatalog * catalog() const =0
IPoolSvc::setShareMode
virtual void setShareMode(bool shareCat)=0
python.output.AtlRunQueryRoot.pf
pf
Definition: AtlRunQueryRoot.py:988
IPoolSvc::disconnectDb
virtual StatusCode disconnectDb(const std::string &connection, unsigned int contextId=IPoolSvc::kInputStream) const =0
Disconnect single Database.
IPoolSvc::PoolStream
PoolStream
Stream to distinguish the POOL Stream instances.
Definition: IPoolSvc.h:40
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IPoolSvc::loadComponent
virtual void loadComponent(const std::string &compName)=0
RootType.h
IPoolSvc::context
virtual const coral::Context * context() const =0
IPoolSvc::getFileSize
virtual long long int getFileSize(const std::string &dbName, long tech, unsigned int contextId) const =0
Get POOL FileSize attribute for database without logging a message.
IPoolSvc::setAttribute
virtual StatusCode setAttribute(const std::string &optName, const std::string &data, long tech, const std::string &dbName, const std::string &contName="", unsigned int contextId=IPoolSvc::kOutputStream) const =0
Set POOL attributes - db/file, container/collection.
IPoolSvc::getAttribute
virtual StatusCode getAttribute(const std::string &optName, std::string &data, long tech, const std::string &dbName, const std::string &contName="", unsigned int contextId=IPoolSvc::kInputStream) const =0
Get POOL attributes - db/file, container/collection.
IPoolSvc::setAttribute
virtual StatusCode setAttribute(const std::string &optName, const std::string &data, long tech, unsigned int contextId=IPoolSvc::kOutputStream) const =0
Set POOL attributes - domain.
python.PyAthena.obj
obj
Definition: PyAthena.py:135
IPoolSvc::getInputContext
virtual unsigned int getInputContext(const std::string &label, unsigned int maxFile=0)=0
IPoolSvc::disconnect
virtual StatusCode disconnect(unsigned int contextId=IPoolSvc::kInputStream) const =0
Disconnect PersistencySvc associated with a stream.
pool::ICollection
Definition: ICollection.h:24
IPoolSvc::createCollection
virtual pool::ICollection * createCollection(const std::string &collectionType, const std::string &connection, const std::string &collectionName, unsigned int contextId=IPoolSvc::kInputStream) const =0
IPoolSvc::connect
virtual StatusCode connect(pool::ITransaction::Type type, unsigned int contextId=IPoolSvc::kInputStream)=0
Connect to a logical database unit; PersistencySvc is chosen according to transaction type (accessmod...
TScopeAdapter
Definition: RootType.h:119