| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Gaudi::MultiFileCatalog Class Reference

This class constitutes the core of the XML based FileCatalog API for using POOL within Gaudi. More...

`#include <src/component/MultiFileCatalog.h>`

Inheritance diagram for Gaudi::MultiFileCatalog:
[legend]
Collaboration diagram for Gaudi::MultiFileCatalog:
[legend]

## Public Types
typedef Service::Factory | Factory
Public Types inherited from extends< Service, IFileCatalog, IFileCatalogMgr >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
| MultiFileCatalog (const std::string &nam, ISvcLocator *svc)
| Create a catalog file, initialization of XercesC. More...
| ~MultiFileCatalog () override=default
| Destructor,. More...
StatusCode | initialize () override
| IService implementation. More...
StatusCode | finalize () override
| Finalize service object. More...
std::string | createFID () const override
| Catalog interface. More...
CSTR | connectInfo () const override
| Access to connect string. More...
void | init () override
| Parse the DOM tree of the XML catalog. More...
void | commit () override
| Save DOM catalog to file. More...
void | rollback () override
| Save DOM catalog to file. More...
bool | readOnly () const override
| Check if the catalog is read-only. More...
bool | dirty () const override
| Check if the catalog should be updated. More...
bool | existsPFN (CSTR pfn) const override
| Return the status of physical file name. More...
std::string | lookupPFN (CSTR pfn) const override
| Lookup file identifier by physical file name. More...
bool | existsLFN (CSTR lfn) const override
| Return the status of a logical file name. More...
std::string | lookupLFN (CSTR lfn) const override
| Lookup file identifier by logical file name. More...
bool | existsFID (CSTR fid) const override
| Return the status of a FileID. More...
void | getPFN (CSTR fid, Files &files) const override
| Dump all physical file names of the catalog and their attributes associate to the FileID. More...
void | getLFN (CSTR fid, Files &files) const override
| Dump all logical file names of the catalog associate to the FileID. More...
void | getFID (Strings &fids) const override
| Dump all file Identifiers. More...
void | deleteFID (CSTR fid) const override
| Delete FileID from the catalog. More...
void | registerPFN (CSTR fid, CSTR pfn, CSTR ftype) const override
| Create a FileID and DOM Node of the PFN with all the attributes. More...
void | registerLFN (CSTR fid, CSTR lfn) const override
| Create a FileID and DOM Node of the LFN with all the attributes. More...
void | registerFID (CSTR fid) const override
| Create a FileID and DOM Node. More...
void | getMetaData (CSTR fid, Attributes &attr) const override
| Dump all MetaData of the catalog for a given file ID. More...
std::string | getMetaDataItem (CSTR fid, CSTR name) const override
| Access metadata item. More...
void | setMetaData (CSTR fid, CSTR attr, CSTR val) const override
| Insert/update metadata item. More...
void | dropMetaData (CSTR fid) const override
| Drop all metadata of one FID. More...
void | dropMetaData (CSTR fid, CSTR attr) const override
| Drop specified metadata item. More...
IFileCatalog * | findCatalog (CSTR connect, bool must_be_writable) const override
| Catalog management. More...
void | addCatalog (CSTR connect) override
| Add new catalog identified by name to the existing ones. More...
void | addCatalog (IFileCatalog *cat) override
| Add new catalog identified by reference to the existing ones. More...
void | removeCatalog (CSTR connect) override
| Remove catalog identified by name from the existing ones. More...
void | removeCatalog (const IFileCatalog *cat) override
| Remove catalog identified by reference from the existing ones. More...
Catalogs & | catalogs () override
| Access catalog container. More...
const Catalogs & | catalogs () const override
| Access catalog container (CONST) More...
IFileCatalog * | writeCatalog (CSTR fid="") const override
| Access to the (first) writable file catalog. More...
void | setWriteCatalog (IFileCatalog *cat) override
| Define the writable catalog identified by reference. More...
void | setWriteCatalog (CSTR connect) override
| Define the writable catalog identified by name. More...
Public Member Functions inherited from extends< Service, IFileCatalog, IFileCatalogMgr >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
StatusCode | setProperty (const Property &p) override
StatusCode | setProperty (const std::string &s) override
StatusCode | setProperty (const std::string &n, const std::string &v) override
StatusCode | getProperty (Property *p) const override
const Property & | getProperty (const std::string &name) const override
StatusCode | getProperty (const std::string &n, std::string &v) const override
const std::vector< Property * > & | getProperties () const override
bool | hasProperty (const std::string &name) const override
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. More...
template<class T >
StatusCode | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Private tool. More...
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Public tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Types
typedef const std::string & | CSTR
typedef std::vector< IFileCatalog * > | Catalogs
typedef std::vector< std::string > | CatalogNames

## Protected Member Functions
template<class A1 , class F >
std::string | _find (A1 &arg1, F pmf) const
template<class A1 , class F >
void | _collect (A1 &arg1, F f) const
template<class A2 , class A1 , class F >
void | _collect (const A2 &arg2, A1 &arg1, F f) const
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Private Member Functions
IFileCatalog * | getCatalog (CSTR fid, bool throw_if_not, bool writable=true, bool prt=true) const
| Find catalog containing a given file identifier. More...
Catalogs::iterator | i_findCatalog (CSTR connect, bool must_be_writable)
| Find catalog by connect string. More...
void | propHandler (Property &)
| simple property handle to allow interactive modification of list of the file catalogs More...
void | printError (CSTR msg, bool throw_exc=true) const
std::string | lookupFID (CSTR lfn) const

## Private Attributes
Catalogs | m_catalogs
| Container with references to known catalogs. More...
CatalogNames | m_catalogNames = { { "xmlcatalog_file:test_catalog.xml" } }
| Property : Container with catalog names. More...
bool | m_started = false
| Flag to indicate if catalog is started. More...
CatalogNames | m_oldNames
| BACKUP:: Container with catalog names. More...

## Additional Inherited Members
Protected Attributes inherited from Service
IntegerProperty | m_outputLevel = MSG::NIL
| Service output level. More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...

## Detailed Description

This class constitutes the core of the XML based FileCatalog API for using POOL within Gaudi.

This class manages multiple file catalogs.

Definition at line 20 of file MultiFileCatalog.h.

## Member Typedef Documentation

typedef std::vector<std::string> Gaudi::MultiFileCatalog::CatalogNames
| protected

Definition at line 31 of file MultiFileCatalog.h.

typedef std::vector<IFileCatalog*> Gaudi::MultiFileCatalog::Catalogs
| protected

Definition at line 30 of file MultiFileCatalog.h.

typedef const std::string& Gaudi::MultiFileCatalog::CSTR
| protected

Definition at line 29 of file MultiFileCatalog.h.

typedef Service::Factory Gaudi::MultiFileCatalog::Factory

Definition at line 26 of file MultiFileCatalog.h.

## Constructor & Destructor Documentation

MultiFileCatalog::MultiFileCatalog | ( | const std::string & | nam,
|  | ISvcLocator * | svc
| ) |  |

Create a catalog file, initialization of XercesC.

Definition at line 24 of file MultiFileCatalog.cpp.

25 : base_class(nam, svc)
26 {
27 declareProperty("Catalogs", m_catalogNames, "The list of Catalogs")
28 -> declareUpdateHandler ( &Gaudi::MultiFileCatalog::propHandler, this ) ;
29 }
Gaudi::MultiFileCatalog::propHandler
void propHandler(Property &)
simple property handle to allow interactive modification of list of the file catalogs ...
Definition: MultiFileCatalog.cpp:250
extends< Service, IFileCatalog, IFileCatalogMgr >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
Gaudi::MultiFileCatalog::m_catalogNames
CatalogNames m_catalogNames
Property : Container with catalog names.
Definition: MultiFileCatalog.h:173
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215

Gaudi::MultiFileCatalog::~MultiFileCatalog | ( |  | ) |
| override default

Destructor,.

## Member Function Documentation

template<class A1 , class F >

void Gaudi::MultiFileCatalog::_collect | ( | A1 & | arg1,
|  | F | f
| ) |  | const
| inline protected

Definition at line 41 of file MultiFileCatalog.h.

41 {
42 A1 tmp;
43 for(const auto & i : m_catalogs ) {
44 f(i,tmp); // tmp = f(i)
45 arg1.insert(arg1.end(),tmp.begin(),tmp.end());
46 tmp.clear();
47 }
48 }
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
ana.i
list i
Definition: ana.py:128
template<class A2 , class A1 , class F >

void Gaudi::MultiFileCatalog::_collect | ( | const A2 & | arg2,
|  | A1 & | arg1,
|  | F | f
| ) |  | const
| inline protected

Definition at line 49 of file MultiFileCatalog.h.

49 {
50 A1 tmp;
51 for(const auto& i : m_catalogs ) {
52 f(i,arg2,tmp); // tmp = f(i,arg2)
53 arg1.insert(arg1.end(),tmp.begin(),tmp.end());
54 tmp.clear();
55 }
56 }
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
ana.i
list i
Definition: ana.py:128
template<class A1 , class F >

std::string Gaudi::MultiFileCatalog::_find | ( | A1 & | arg1,
|  | F | pmf
| ) |  | const
| inline protected

Definition at line 33 of file MultiFileCatalog.h.

33 {
34 std::string result;
35 for(const auto& i : m_catalogs ) {
36 result= (i->*pmf)(arg1);
37 if ( !result.empty() ) break;
38 }
39 return result;
40 }
std::string::empty
T empty(T...args)
std::string
STL class.
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
ana.i
list i
Definition: ana.py:128

void MultiFileCatalog::addCatalog | ( | CSTR | connect | ) |
| override

Add new catalog identified by name to the existing ones.

Catalog is already present ... silently ignore request

Definition at line 117 of file MultiFileCatalog.cpp.

117 {
118 if ( !con.empty() ) {
119 if ( !findCatalog(con,false) ) {
120 static const string xml_typ = "Gaudi::XMLFileCatalog";
121 auto id0 = con.find("_");
122 string typ = con.substr(0,id0);
123 string url = con.substr(id0+1);
124 IInterface* cat = nullptr;
125 if ( strncasecmp("xml",typ.c_str(),3) == 0 ) {
126 cat = IFileCatalog::Factory::create(xml_typ,url,msgSvc().get());
127 } else {
128 using Gaudi::PluginService::Details::Registry;
129 Registry& registry = Registry::instance();
130 if (registry.getInfo(typ).type ==
131 typeid(Service::Factory::FuncType).name()) {
132 cat = Service::Factory::create(typ,url,serviceLocator().get());
133 } else if (registry.getInfo(typ).type ==
134 typeid(IFileCatalog::Factory::FuncType).name()) {
135 cat = IFileCatalog::Factory::create(typ,url,msgSvc().get());
136 }
137 }
138 if ( cat ) {
139 auto fileCat = SmartIF<IFileCatalog>( cat ) ;
140 if ( fileCat ) {
141 addCatalog(fileCat.get()); //addCatalog will take care of the refCount of fileCat...
142 return;
143 }
144 }
145 printError("Failed to create catalog connection:"+con,true);
146 }
148 return;
149 }
150 printError("Got invalid (empty) catalog connection string.",true);
151 }
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
Gaudi::MultiFileCatalog::findCatalog
IFileCatalog * findCatalog(CSTR connect, bool must_be_writable) const override
Catalog management.
Definition: MultiFileCatalog.cpp:88
Gaudi::MultiFileCatalog::printError
void printError(CSTR msg, bool throw_exc=true) const
Definition: MultiFileCatalog.cpp:109
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:63
std::string::c_str
T c_str(T...args)
Gaudi::MultiFileCatalog::addCatalog
void addCatalog(CSTR connect) override
Add new catalog identified by name to the existing ones.
Definition: MultiFileCatalog.cpp:117
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99

void MultiFileCatalog::addCatalog | ( | IFileCatalog * | cat | ) |
| override

Add new catalog identified by reference to the existing ones.

Definition at line 153 of file MultiFileCatalog.cpp.

153 {
154 if ( cat ) {
155 cat->addRef();
156 m_catalogs.push_back(cat);
157 return;
158 }
159 printError("Got invalid catalog to be added to multi catalog.",true);
160 }
Gaudi::MultiFileCatalog::printError
void printError(CSTR msg, bool throw_exc=true) const
Definition: MultiFileCatalog.cpp:109
std::vector::push_back
T push_back(T...args)
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.

Catalogs& Gaudi::MultiFileCatalog::catalogs | ( |  | ) |
| inline override

Access catalog container.

Definition at line 146 of file MultiFileCatalog.h.

146 { return m_catalogs; }
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171

const Catalogs& Gaudi::MultiFileCatalog::catalogs | ( |  | ) | const
| inline override

Access catalog container (CONST)

Definition at line 148 of file MultiFileCatalog.h.

148 { return m_catalogs; }
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171

void MultiFileCatalog::commit | ( |  | ) |
| override

Save DOM catalog to file.

Definition at line 244 of file MultiFileCatalog.cpp.

245 { for_each(m_catalogs,[](IFileCatalog* i) { i->commit(); } ); }
Gaudi::IFileCatalog::commit
virtual void commit()=0
Save catalog to file.
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
std::for_each
T for_each(T...args)
ana.i
list i
Definition: ana.py:128

MultiFileCatalog::CSTR MultiFileCatalog::connectInfo | ( |  | ) | const
| override

Access to connect string.

Definition at line 64 of file MultiFileCatalog.cpp.

64 {
65 static const string s("MultiCatalog");
66 return s;
67 }
gaudirun.s
string s
Definition: gaudirun.py:245

std::string MultiFileCatalog::createFID | ( |  | ) | const
| override

Catalog interface.

Create file identifier using UUID mechanism.

Create file identifier using UUID mechanism

Definition at line 60 of file MultiFileCatalog.cpp.

60 {
61 return createGuidAsString();
62 }
Gaudi::createGuidAsString
std::string createGuidAsString()
Create file identifier using UUID mechanism.
Definition: XMLFileCatalog.cpp:188

void Gaudi::MultiFileCatalog::deleteFID | ( | CSTR | fid | ) | const
| inline override

Delete FileID from the catalog.

Definition at line 110 of file MultiFileCatalog.h.

111 { writeCatalog(fid)->deleteFID(fid); }
Gaudi::IFileCatalog::deleteFID
virtual void deleteFID(const std::string &FileID) const =0
Delete FileID Node from the catalog.
Gaudi::MultiFileCatalog::writeCatalog
IFileCatalog * writeCatalog(CSTR fid="") const override
Access to the (first) writable file catalog.
Definition: MultiFileCatalog.h:150

bool MultiFileCatalog::dirty | ( |  | ) | const
| override

Check if the catalog should be updated.

Definition at line 236 of file MultiFileCatalog.cpp.

237 { return std::any_of( std::begin(m_catalogs), std::end(m_catalogs),
238 [](const IFileCatalog* i) { return i->dirty();} ) ;
239 }
std::end
T end(T...args)
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
std::begin
T begin(T...args)
std::any_of
T any_of(T...args)
ana.i
list i
Definition: ana.py:128
Gaudi::IFileCatalog::dirty
virtual bool dirty() const =0
Check if the catalog should be updated.

void Gaudi::MultiFileCatalog::dropMetaData | ( | CSTR | fid | ) | const
| inline override

Drop all metadata of one FID.

Definition at line 128 of file MultiFileCatalog.h.

129 { writeCatalog(fid)->dropMetaData(fid); }
Gaudi::IFileCatalog::dropMetaData
virtual void dropMetaData(const std::string &fid) const =0
Drop all metadata of one FID.
Gaudi::MultiFileCatalog::writeCatalog
IFileCatalog * writeCatalog(CSTR fid="") const override
Access to the (first) writable file catalog.
Definition: MultiFileCatalog.h:150

void Gaudi::MultiFileCatalog::dropMetaData | ( | CSTR | fid,
|  | CSTR | attr
| ) |  | const
| inline override

Drop specified metadata item.

Definition at line 131 of file MultiFileCatalog.h.

132 { writeCatalog(fid)->dropMetaData(fid,attr); }
Gaudi::IFileCatalog::dropMetaData
virtual void dropMetaData(const std::string &fid) const =0
Drop all metadata of one FID.
Gaudi::MultiFileCatalog::writeCatalog
IFileCatalog * writeCatalog(CSTR fid="") const override
Access to the (first) writable file catalog.
Definition: MultiFileCatalog.h:150

bool Gaudi::MultiFileCatalog::existsFID | ( | CSTR | fid | ) | const
| inline override

Return the status of a FileID.

Definition at line 97 of file MultiFileCatalog.h.

98 { return 0 != getCatalog(fid,false,false,false); }
Gaudi::MultiFileCatalog::getCatalog
IFileCatalog * getCatalog(CSTR fid, bool throw_if_not, bool writable=true, bool prt=true) const
Find catalog containing a given file identifier.
Definition: MultiFileCatalog.cpp:69

bool Gaudi::MultiFileCatalog::existsLFN | ( | CSTR | lfn | ) | const
| inline override

Return the status of a logical file name.

Definition at line 91 of file MultiFileCatalog.h.

92 { return !lookupLFN(lfn).empty(); }
std::string::empty
T empty(T...args)
Gaudi::MultiFileCatalog::lookupLFN
std::string lookupLFN(CSTR lfn) const override
Lookup file identifier by logical file name.
Definition: MultiFileCatalog.h:94

bool Gaudi::MultiFileCatalog::existsPFN | ( | CSTR | pfn | ) | const
| inline override

Return the status of physical file name.

Definition at line 85 of file MultiFileCatalog.h.

86 { return !lookupPFN(pfn).empty(); }
std::string::empty
T empty(T...args)
Gaudi::MultiFileCatalog::lookupPFN
std::string lookupPFN(CSTR pfn) const override
Lookup file identifier by physical file name.
Definition: MultiFileCatalog.h:88

StatusCode MultiFileCatalog::finalize | ( |  | ) |
| override

Finalize service object.

Definition at line 51 of file MultiFileCatalog.cpp.

51 {
52 commit();
53 for_each(m_catalogs, [](IFileCatalog* i) { i->release(); } );
54 m_catalogs.clear();
55 m_started = false;
56 return Service::finalize();
57 }
Gaudi::MultiFileCatalog::m_started
bool m_started
Flag to indicate if catalog is started.
Definition: MultiFileCatalog.h:175
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:193
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
std::vector::clear
T clear(T...args)
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
std::for_each
T for_each(T...args)
Gaudi::MultiFileCatalog::commit
void commit() override
Save DOM catalog to file.
Definition: MultiFileCatalog.cpp:244
ana.i
list i
Definition: ana.py:128

IFileCatalog * MultiFileCatalog::findCatalog | ( | CSTR | connect,
|  | bool | must_be_writable
| ) |  | const
| override

Catalog management.

Find catalog by connect string

Definition at line 88 of file MultiFileCatalog.cpp.

88 {
89 auto i = std::find_if(m_catalogs.begin(), m_catalogs.end(),
90 [&](const IFileCatalog* f){
91 return connect == f->connectInfo();
92 } );
93 return ( i!=m_catalogs.end() &&
94 ( !must_be_writable || !(*i)->readOnly() ) ) ? *i : nullptr;
95 }
std::vector::end
T end(T...args)
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
std::find_if
T find_if(T...args)
std::vector::begin
T begin(T...args)
ana.i
list i
Definition: ana.py:128

IFileCatalog * MultiFileCatalog::getCatalog | ( | CSTR | fid,
|  | bool | throw_if_not,
|  | bool | writable = `true`,
|  | bool | prt = `true`
| ) |  | const
| private

Find catalog containing a given file identifier.

Definition at line 69 of file MultiFileCatalog.cpp.

73 {
74 for( const auto& c : m_catalogs ) {
75 if ( !c || ( writable && c->readOnly() )) continue;
76 if ( fid.empty() || ( !fid.empty() && c->existsFID(fid) ) )
77 return c;
78 }
79 if ( prt ) {
80 printError("No writable file catalog found which contains FID:"+fid,throw_if_not);
81 }
82 else {
83 debug() << "No writable file catalog found which contains FID:" << fid << endmsg;
84 }
85 return nullptr;
86 }
std::string::empty
T empty(T...args)
gaudirun.c
tuple c
Definition: gaudirun.py:391
Gaudi::MultiFileCatalog::printError
void printError(CSTR msg, bool throw_exc=true) const
Definition: MultiFileCatalog.cpp:109
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void Gaudi::MultiFileCatalog::getFID | ( | Strings & | fids | ) | const
| inline override

Dump all file Identifiers.

Definition at line 107 of file MultiFileCatalog.h.

108 { _collect(fids,std::mem_fn(&IFileCatalog::getFID)); }
Gaudi::IFileCatalog::getFID
virtual void getFID(Strings &fids) const =0
Dump all file Identifiers.
Gaudi::MultiFileCatalog::_collect
void _collect(A1 &arg1, F f) const
Definition: MultiFileCatalog.h:41
std::mem_fn
T mem_fn(T...args)

void Gaudi::MultiFileCatalog::getLFN | ( | CSTR | fid,
|  | Files & | files
| ) |  | const
| inline override

Dump all logical file names of the catalog associate to the FileID.

Definition at line 103 of file MultiFileCatalog.h.

104 { _collect(fid,files,std::mem_fn(&IFileCatalog::getLFN)); }
Gaudi::MultiFileCatalog::_collect
void _collect(A1 &arg1, F f) const
Definition: MultiFileCatalog.h:41
Gaudi::IFileCatalog::getLFN
virtual void getLFN(const std::string &fid, Files &files) const =0
Dump all LFNames of the catalog associate to the FileID.
std::mem_fn
T mem_fn(T...args)

void Gaudi::MultiFileCatalog::getMetaData | ( | CSTR | fid,
|  | Attributes & | attr
| ) |  | const
| inline override

Dump all MetaData of the catalog for a given file ID.

Definition at line 120 of file MultiFileCatalog.h.

121 { _collect(fid,attr,std::mem_fn(&IFileCatalog::getMetaData)); }
Gaudi::IFileCatalog::getMetaData
virtual void getMetaData(const std::string &fid, Attributes &attr) const =0
Dump all MetaData of the catalog for a given file ID.
Gaudi::MultiFileCatalog::_collect
void _collect(A1 &arg1, F f) const
Definition: MultiFileCatalog.h:41
std::mem_fn
T mem_fn(T...args)

string MultiFileCatalog::getMetaDataItem | ( | CSTR | fid,
|  | CSTR | name
| ) |  | const
| override

Access metadata item.

Definition at line 210 of file MultiFileCatalog.cpp.

210 {
211 std::string result;
212 for(const auto& i : m_catalogs ) {
213 result = i->getMetaDataItem(fid,attr);
214 if ( !result.empty() ) break;
215 }
216 return result;
217 }
std::string::empty
T empty(T...args)
std::string
STL class.
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
ana.i
list i
Definition: ana.py:128

void Gaudi::MultiFileCatalog::getPFN | ( | CSTR | fid,
|  | Files & | files
| ) |  | const
| inline override

Dump all physical file names of the catalog and their attributes associate to the FileID.

Definition at line 100 of file MultiFileCatalog.h.

101 { _collect(fid,files,std::mem_fn(&IFileCatalog::getPFN)); }
Gaudi::IFileCatalog::getPFN
virtual void getPFN(const std::string &fid, Files &files) const =0
Dump all PFNames of the catalog and their attributes associate to the FileID.
Gaudi::MultiFileCatalog::_collect
void _collect(A1 &arg1, F f) const
Definition: MultiFileCatalog.h:41
std::mem_fn
T mem_fn(T...args)

MultiFileCatalog::Catalogs::iterator MultiFileCatalog::i_findCatalog | ( | CSTR | connect,
|  | bool | must_be_writable
| ) |  |
| private

Find catalog by connect string.

Definition at line 98 of file MultiFileCatalog.cpp.

98 {
99 auto i = std::find_if(m_catalogs.begin(), m_catalogs.end(),
100 [&](const IFileCatalog* f){
101 return connect == f->connectInfo();
102 } );
103 if ( i!=m_catalogs.end() && must_be_writable && (*i)->readOnly() ) {
104 i = m_catalogs.end();
105 }
106 return i;
107 }
std::vector::end
T end(T...args)
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
std::find_if
T find_if(T...args)
std::vector::begin
T begin(T...args)
Gaudi::IFileCatalog::readOnly
virtual bool readOnly() const =0
Check if the catalog is read-only.
ana.i
list i
Definition: ana.py:128

void MultiFileCatalog::init | ( |  | ) |
| override

Parse the DOM tree of the XML catalog.

Definition at line 241 of file MultiFileCatalog.cpp.

242 { for_each(m_catalogs,[](IFileCatalog* i) { i->init(); }); m_started=true; }
Gaudi::MultiFileCatalog::m_started
bool m_started
Flag to indicate if catalog is started.
Definition: MultiFileCatalog.h:175
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
Gaudi::IFileCatalog::init
virtual void init()=0
Parse the DOM tree of the XML catalog.
std::for_each
T for_each(T...args)
ana.i
list i
Definition: ana.py:128

StatusCode MultiFileCatalog::initialize | ( |  | ) |
| override

IService implementation.

Finalize service object

Definition at line 31 of file MultiFileCatalog.cpp.

31 {
32 if ( !Service::initialize().isSuccess() ) {
33 printError("Failed to initialize service base class.",false);
34 return StatusCode::SUCCESS;
35 }
36 std::string current;
37 try {
38 for(const auto& i : m_catalogNames ) {
39 current = i;
40 addCatalog(i);
41 }
42 init();
43 return StatusCode::SUCCESS;
44 }
45 catch(const std::exception& /* e */) {
46 printError("Cannot add file catalog:"+current,false);
47 }
48 return StatusCode::FAILURE;
49 }
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:68
Gaudi::MultiFileCatalog::printError
void printError(CSTR msg, bool throw_exc=true) const
Definition: MultiFileCatalog.cpp:109
std::string
STL class.
StatusCode::FAILURE
Definition: StatusCode.h:29
Gaudi::MultiFileCatalog::m_catalogNames
CatalogNames m_catalogNames
Property : Container with catalog names.
Definition: MultiFileCatalog.h:173
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::exception
STL class.
Gaudi::MultiFileCatalog::init
void init() override
Parse the DOM tree of the XML catalog.
Definition: MultiFileCatalog.cpp:241
Gaudi::MultiFileCatalog::addCatalog
void addCatalog(CSTR connect) override
Add new catalog identified by name to the existing ones.
Definition: MultiFileCatalog.cpp:117
ana.i
list i
Definition: ana.py:128

std::string Gaudi::MultiFileCatalog::lookupFID | ( | CSTR | lfn | ) | const
| private

std::string Gaudi::MultiFileCatalog::lookupLFN | ( | CSTR | lfn | ) | const
| inline override

Lookup file identifier by logical file name.

Definition at line 94 of file MultiFileCatalog.h.

95 { return _find(lfn,&IFileCatalog::lookupLFN); }
Gaudi::IFileCatalog::lookupLFN
virtual std::string lookupLFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
Gaudi::MultiFileCatalog::_find
std::string _find(A1 &arg1, F pmf) const
Definition: MultiFileCatalog.h:33

std::string Gaudi::MultiFileCatalog::lookupPFN | ( | CSTR | pfn | ) | const
| inline override

Lookup file identifier by physical file name.

Definition at line 88 of file MultiFileCatalog.h.

89 { return _find(pfn,&IFileCatalog::lookupPFN); }
Gaudi::IFileCatalog::lookupPFN
virtual std::string lookupPFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
Gaudi::MultiFileCatalog::_find
std::string _find(A1 &arg1, F pmf) const
Definition: MultiFileCatalog.h:33

void MultiFileCatalog::printError | ( | CSTR | msg,
|  | bool | throw_exc = `true`
| ) |  | const
| private

Definition at line 109 of file MultiFileCatalog.cpp.

109 {
110 if ( rethrow ) {
111 fatal() << msg << endmsg;
112 throw runtime_error("Catalog> "+msg);
113 }
114 error() << msg << endmsg;
115 }
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
std::runtime_error
STL class.
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void MultiFileCatalog::propHandler | ( | Property & |  | ) |
| private

simple property handle to allow interactive modification of list of the file catalogs

Definition at line 250 of file MultiFileCatalog.cpp.

251 {
252 // not yet initialized
253 if ( !m_started ) { m_oldNames = m_catalogNames; return; } // RETURN
254 // no real change - no action
255 if ( m_catalogNames == m_oldNames ) { return; }
256 m_oldNames = m_catalogNames ;
257 // remove ALL catalogs
258 removeCatalog("") ;
259 // add new catalogs
260 for ( const auto& inew : m_catalogNames ) addCatalog ( inew ) ;
261 // start
262 init() ;
263 //
264 debug()
265 << "New catalogs to be used: "
266 << Gaudi::Utils::toString ( m_catalogNames ) << endmsg ;
267 }
Gaudi::MultiFileCatalog::m_started
bool m_started
Flag to indicate if catalog is started.
Definition: MultiFileCatalog.h:175
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:371
Gaudi::MultiFileCatalog::m_catalogNames
CatalogNames m_catalogNames
Property : Container with catalog names.
Definition: MultiFileCatalog.h:173
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
Gaudi::MultiFileCatalog::m_oldNames
CatalogNames m_oldNames
BACKUP:: Container with catalog names.
Definition: MultiFileCatalog.h:177
Gaudi::MultiFileCatalog::init
void init() override
Parse the DOM tree of the XML catalog.
Definition: MultiFileCatalog.cpp:241
Gaudi::MultiFileCatalog::addCatalog
void addCatalog(CSTR connect) override
Add new catalog identified by name to the existing ones.
Definition: MultiFileCatalog.cpp:117
Gaudi::MultiFileCatalog::removeCatalog
void removeCatalog(CSTR connect) override
Remove catalog identified by name from the existing ones.
Definition: MultiFileCatalog.cpp:162
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

bool MultiFileCatalog::readOnly | ( |  | ) | const
| override

Check if the catalog is read-only.

Definition at line 231 of file MultiFileCatalog.cpp.

232 { return std::all_of( std::begin(m_catalogs), std::end(m_catalogs),
233 [](const IFileCatalog* i) { return i->readOnly(); } );
234 }
std::end
T end(T...args)
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
std::begin
T begin(T...args)
std::all_of
T all_of(T...args)
Gaudi::IFileCatalog::readOnly
virtual bool readOnly() const =0
Check if the catalog is read-only.
ana.i
list i
Definition: ana.py:128

void Gaudi::MultiFileCatalog::registerFID | ( | CSTR | fid | ) | const
| inline override

Create a FileID and DOM Node.

Definition at line 117 of file MultiFileCatalog.h.

118 { writeCatalog()->registerFID(fid); }
Gaudi::IFileCatalog::registerFID
virtual void registerFID(const std::string &fid) const =0
Create a Node for a FileID and DOM Node.
Gaudi::MultiFileCatalog::writeCatalog
IFileCatalog * writeCatalog(CSTR fid="") const override
Access to the (first) writable file catalog.
Definition: MultiFileCatalog.h:150

void MultiFileCatalog::registerLFN | ( | CSTR | fid,
|  | CSTR | lfn
| ) |  | const
| override

Create a FileID and DOM Node of the LFN with all the attributes.

Definition at line 225 of file MultiFileCatalog.cpp.

225 {
226 IFileCatalog* c = getCatalog(fid,false,true,false);
227 if ( !c ) c = getCatalog("",true,true,true);
228 c->registerLFN(fid, lfn);
229 }
gaudirun.c
tuple c
Definition: gaudirun.py:391
Gaudi::MultiFileCatalog::getCatalog
IFileCatalog * getCatalog(CSTR fid, bool throw_if_not, bool writable=true, bool prt=true) const
Find catalog containing a given file identifier.
Definition: MultiFileCatalog.cpp:69
Gaudi::IFileCatalog::registerLFN
virtual void registerLFN(const std::string &fid, const std::string &lfn) const =0
Create a Node for a FileID and DOM Node of the LFN with all the attributes.
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24

void MultiFileCatalog::registerPFN | ( | CSTR | fid,
|  | CSTR | pfn,
|  | CSTR | ftype
| ) |  | const
| override

Create a FileID and DOM Node of the PFN with all the attributes.

Definition at line 219 of file MultiFileCatalog.cpp.

219 {
220 IFileCatalog* c = getCatalog(fid,false,true,false);
221 if ( !c ) c = getCatalog("",true,true,true);
222 c->registerPFN(fid, pfn, ftype);
223 }
Gaudi::IFileCatalog::registerPFN
virtual void registerPFN(const std::string &fid, const std::string &pfn, const std::string &ftype) const =0
Create a Node for a FileID and DOM Node of the PFN with all the attributes.
gaudirun.c
tuple c
Definition: gaudirun.py:391
Gaudi::MultiFileCatalog::getCatalog
IFileCatalog * getCatalog(CSTR fid, bool throw_if_not, bool writable=true, bool prt=true) const
Find catalog containing a given file identifier.
Definition: MultiFileCatalog.cpp:69
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24

void MultiFileCatalog::removeCatalog | ( | CSTR | connect | ) |
| override

Remove catalog identified by name from the existing ones.

Definition at line 162 of file MultiFileCatalog.cpp.

162 {
163 if ( con.empty() || con == "*" ) {
164 for_each(m_catalogs, [](IFileCatalog* i) { i->release(); } );
165 m_catalogs.clear();
166 return;
167 }
168 removeCatalog(findCatalog(con,false));
169 }
Gaudi::MultiFileCatalog::findCatalog
IFileCatalog * findCatalog(CSTR connect, bool must_be_writable) const override
Catalog management.
Definition: MultiFileCatalog.cpp:88
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
std::vector::clear
T clear(T...args)
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
std::for_each
T for_each(T...args)
ana.i
list i
Definition: ana.py:128
Gaudi::MultiFileCatalog::removeCatalog
void removeCatalog(CSTR connect) override
Remove catalog identified by name from the existing ones.
Definition: MultiFileCatalog.cpp:162

void MultiFileCatalog::removeCatalog | ( | const IFileCatalog * | cat | ) |
| override

Remove catalog identified by reference from the existing ones.

Definition at line 171 of file MultiFileCatalog.cpp.

171 {
172 if ( cat ) {
173 auto i=find(m_catalogs.begin(),m_catalogs.end(),cat);
174 if ( i != m_catalogs.end() ) {
175 (*i)->release();
176 m_catalogs.erase(i);
177 return;
178 }
179 printError("Unknown file catalog -- cannot be removed.",true);
180 }
181 printError("Invalid file catalog.",true);
182 }
Gaudi::MultiFileCatalog::printError
void printError(CSTR msg, bool throw_exc=true) const
Definition: MultiFileCatalog.cpp:109
std::vector::end
T end(T...args)
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
std::vector::erase
T erase(T...args)
std::find
T find(T...args)
std::vector::begin
T begin(T...args)
ana.i
list i
Definition: ana.py:128

void MultiFileCatalog::rollback | ( |  | ) |
| override

Save DOM catalog to file.

Definition at line 247 of file MultiFileCatalog.cpp.

248 { for_each(m_catalogs, [](IFileCatalog* i) { i->rollback(); } ); }
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::IFileCatalog
File catalog interface.
Definition: IFileCatalog.h:24
Gaudi::IFileCatalog::rollback
virtual void rollback()=0
Save catalog to file.
std::for_each
T for_each(T...args)
ana.i
list i
Definition: ana.py:128

void Gaudi::MultiFileCatalog::setMetaData | ( | CSTR | fid,
|  | CSTR | attr,
|  | CSTR | val
| ) |  | const
| inline override

Insert/update metadata item.

Definition at line 125 of file MultiFileCatalog.h.

126 { writeCatalog(fid)->setMetaData(fid,attr,val); }
Gaudi::IFileCatalog::setMetaData
virtual void setMetaData(const std::string &fid, const std::string &name, const std::string &value) const =0
Insert/update metadata item.
Gaudi::MultiFileCatalog::writeCatalog
IFileCatalog * writeCatalog(CSTR fid="") const override
Access to the (first) writable file catalog.
Definition: MultiFileCatalog.h:150

void MultiFileCatalog::setWriteCatalog | ( | IFileCatalog * | cat | ) |
| override

Define the writable catalog identified by reference.

Definition at line 184 of file MultiFileCatalog.cpp.

184 {
185 if ( cat ) {
186 if ( !cat->readOnly() ) {
187 auto i=find(m_catalogs.begin(),m_catalogs.end(),cat);
188 if ( i != m_catalogs.end() ) {
189 m_catalogs.erase(i);
190 m_catalogs.insert(m_catalogs.begin(),cat);
191 return;
192 }
193 printError("The catalog "+cat->connectInfo()+" is not known.",true);
194 }
195 printError("The catalog "+cat->connectInfo()+" is not writable.",true);
196 }
197 printError("Invalid file catalog.",true);
198 }
Gaudi::MultiFileCatalog::printError
void printError(CSTR msg, bool throw_exc=true) const
Definition: MultiFileCatalog.cpp:109
std::vector::end
T end(T...args)
Gaudi::IFileCatalog::connectInfo
virtual const std::string & connectInfo() const =0
Access to connect string.
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
std::vector::erase
T erase(T...args)
std::vector::insert
T insert(T...args)
std::find
T find(T...args)
std::vector::begin
T begin(T...args)
Gaudi::IFileCatalog::readOnly
virtual bool readOnly() const =0
Check if the catalog is read-only.
ana.i
list i
Definition: ana.py:128

void MultiFileCatalog::setWriteCatalog | ( | CSTR | connect | ) |
| override

Define the writable catalog identified by name.

Definition at line 200 of file MultiFileCatalog.cpp.

200 {
201 auto i = i_findCatalog(connect,true);
202 if ( i == m_catalogs.end() ) {
203 addCatalog(connect);
204 setWriteCatalog(findCatalog(connect,true));
205 return;
206 }
207 setWriteCatalog(*i);
208 }
Gaudi::MultiFileCatalog::findCatalog
IFileCatalog * findCatalog(CSTR connect, bool must_be_writable) const override
Catalog management.
Definition: MultiFileCatalog.cpp:88
Gaudi::MultiFileCatalog::setWriteCatalog
void setWriteCatalog(IFileCatalog *cat) override
Define the writable catalog identified by reference.
Definition: MultiFileCatalog.cpp:184
std::vector::end
T end(T...args)
Gaudi::MultiFileCatalog::i_findCatalog
Catalogs::iterator i_findCatalog(CSTR connect, bool must_be_writable)
Find catalog by connect string.
Definition: MultiFileCatalog.cpp:98
Gaudi::MultiFileCatalog::m_catalogs
Catalogs m_catalogs
Container with references to known catalogs.
Definition: MultiFileCatalog.h:171
Gaudi::MultiFileCatalog::addCatalog
void addCatalog(CSTR connect) override
Add new catalog identified by name to the existing ones.
Definition: MultiFileCatalog.cpp:117
ana.i
list i
Definition: ana.py:128

IFileCatalog* Gaudi::MultiFileCatalog::writeCatalog | ( | CSTR | fid = `""` | ) | const
| inline override

Access to the (first) writable file catalog.

Definition at line 150 of file MultiFileCatalog.h.

151 { return getCatalog(fid,true,true,false); }
Gaudi::MultiFileCatalog::getCatalog
IFileCatalog * getCatalog(CSTR fid, bool throw_if_not, bool writable=true, bool prt=true) const
Find catalog containing a given file identifier.
Definition: MultiFileCatalog.cpp:69

## Member Data Documentation

CatalogNames Gaudi::MultiFileCatalog::m_catalogNames = { { "xmlcatalog_file:test_catalog.xml" } }
| private

Property : Container with catalog names.

Definition at line 173 of file MultiFileCatalog.h.

Catalogs Gaudi::MultiFileCatalog::m_catalogs
| private

Container with references to known catalogs.

Definition at line 171 of file MultiFileCatalog.h.

CatalogNames Gaudi::MultiFileCatalog::m_oldNames
| private

BACKUP:: Container with catalog names.

Definition at line 177 of file MultiFileCatalog.h.

bool Gaudi::MultiFileCatalog::m_started = false
| private

Flag to indicate if catalog is started.

Definition at line 175 of file MultiFileCatalog.h.

The documentation for this class was generated from the following files:

- GaudiUtils/src/component/MultiFileCatalog.h
- GaudiUtils/src/component/MultiFileCatalog.cpp