ATLAS Offline Software
CollectionService.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef COLLECTIONBASE_COLLECTIONSERVICE_H
6 #define COLLECTIONBASE_COLLECTIONSERVICE_H
7 
10 
11 
12 namespace pool {
13 
14  class IFileCatalog;
15 
26  {
27  // DECLARE_SEAL_COMPONENT;
28 
29  public:
36 
37 
39  virtual ~CollectionService();
40 
49  bool overwrite = false );
50 
62  bool overwrite = false,
63  std::string logicalName = "" );
64 
65 
66  virtual ICollection* open( const std::string& name,
67  const std::string& type,
68  std::string connection = "",
69  bool readOnly = true) const
70  {
71  return handle(name, type, connection, readOnly, 0);
72  }
73 
74 
86  virtual bool registerExisting( const std::string& name,
87  const std::string& type,
88  std::string connection = "",
89  std::string logicalName = "" );
90 
91 
100  virtual bool registerExisting( ICollection* collection,
101  bool overwrite = false,
102  std::string logicalName = "" );
103 
117  virtual ICollection* handle( const std::string& name,
118  const std::string& type,
119  std::string connection = "",
120  bool readOnly = true,
121  ISession* session = 0 ) const;
122 
132  virtual ICollection* openWithPhysicalName( const std::string& physicalName,
134 
144  virtual ICollection* openWithLogicalName( const std::string& logicalName,
145  bool readOnly = true );
146 
156  virtual ICollection* openWithGuid( const std::string& guid,
157  bool readOnly = true );
158 
160  virtual bool setDefaultCatalog();
161 
166  virtual void setCatalog( IFileCatalog* collCat );
167 
173  virtual bool setWriteCatalog( const std::string& name );
174 
180  virtual bool addReadCatalog( const std::string& name );
181 
186 
187  };
188 }
189 
190 #endif
191 
pool::CollectionService::create
virtual ICollection * create(const ICollectionDescription &description, bool overwrite=false)
Creates or overwrites a collection or collection fragment, given a description of its properties.
pool::CollectionService::registerExisting
virtual bool registerExisting(ICollection *collection, bool overwrite=false, std::string logicalName="")
Registers an existing collection in a collection catalog managed by the collection service.
pool
pool namespace
Definition: libname.h:15
pool::CollectionService::setWriteCatalog
virtual bool setWriteCatalog(const std::string &name)
Sets the name of the catalog in which to register new collections.
pool::CollectionService::open
virtual ICollection * open(const std::string &name, const std::string &type, std::string connection="", bool readOnly=true) const
Definition: CollectionService.h:66
pool::ISession
Definition: ISession.h:31
pool::CollectionService::handle
virtual ICollection * handle(const std::string &name, const std::string &type, std::string connection="", bool readOnly=true, ISession *session=0) const
Retrieves a handle to an existing collection or collection fragment for read or update transactions,...
pool::IFileCatalog
Definition: IFileCatalog.h:23
pool::ICollection::OpenMode
OpenMode
Enumeration of the possible open modes of the collection.
Definition: ICollection.h:27
pool::CollectionService::createAndRegister
virtual ICollection * createAndRegister(const ICollectionDescription &description, bool overwrite=false, std::string logicalName="")
Creates or overwrites a collection, given a description of its properties, and registers it in a coll...
pool::CollectionService::setDefaultCatalog
virtual bool setDefaultCatalog()
Sets default values for the write and read collection catalogs.
pool_uuid.guid
guid
Definition: pool_uuid.py:112
pool::CollectionService::CollectionService
CollectionService()
Constructor:
pool::CollectionService::getCatalog
virtual IFileCatalog * getCatalog()
Returns the collection catalog used by the service.
pool::ICollectionService
Definition: ICollectionService.h:33
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
pool::CollectionService::addReadCatalog
virtual bool addReadCatalog(const std::string &name)
Adds a catalog to the list of catalogs in which to search for registered collections.
pool::CollectionService::registerExisting
virtual bool registerExisting(const std::string &name, const std::string &type, std::string connection="", std::string logicalName="")
Registers an existing collection in a collection catalog managed by the collection service,...
pool::CollectionService::openWithPhysicalName
virtual ICollection * openWithPhysicalName(const std::string &physicalName, pool::ICollection::OpenMode openMode=pool::ICollection::READ)
Retrieves a handle to an existing collection for read or update transactions, given the physical name...
pool::CollectionService::openWithLogicalName
virtual ICollection * openWithLogicalName(const std::string &logicalName, bool readOnly=true)
Retrieves a handle to an existing collection for read or update transactions, given the logical name ...
pool::ICollection::READ
@ READ
Definition: ICollection.h:27
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
pool::ATLAS_NOT_THREAD_SAFE
DbStatus DbObjectHandle< T >::makeLink ATLAS_NOT_THREAD_SAFE(const Token *pToken, Token::OID_t &linkH) const
Add persistent association entry.
Definition: DbObject.h:220
pool::CollectionService
Definition: CollectionService.h:26
pool::CollectionService::~CollectionService
virtual ~CollectionService()
Default destructor.
pool::CollectionService::setCatalog
virtual void setCatalog(IFileCatalog *collCat)
Forces the service to use externally provided file catalogs The catalogs are not deleted by the servi...
checker_macros.h
Define macros for attributes used to control the static checker.
ICollectionService.h
pool::ICollection
Definition: ICollection.h:24
pool::CollectionService::openWithGuid
virtual ICollection * openWithGuid(const std::string &guid, bool readOnly=true)
Retrieves a handle to an existing collection for read or update transactions, given the globally uniq...
pool::ICollectionDescription
Definition: ICollectionDescription.h:26
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88