ATLAS Offline Software
Loading...
Searching...
No Matches
pool::IFileCatalog Class Reference

#include <IFileCatalog.h>

Inheritance diagram for pool::IFileCatalog:
Collaboration diagram for pool::IFileCatalog:

Public Types

typedef Gaudi::IFileCatalog::Files Files
typedef Gaudi::IFileCatalog::Strings Strings
typedef Gaudi::IFileCatalogMgr::Catalogs Catalogs

Public Member Functions

 IFileCatalog ()
 ~IFileCatalog ()
std::string createFID () const
 Create file identifier using UUID mechanism.
void connect ()
void disconnect ()
const std::string & connectInfo () const
 Get the connect string.
void start ()
 redirect to init() for Gaudi FC
void init ()
 Parse the DOM tree of the XML catalog.
void commit ()
 Save catalog to file.
void rollback ()
 Save catalog to file.
bool readOnly () const
 Check if the catalog is read-only.
bool dirty () const
 Check if the catalog should be updated.
void getFIDs (Strings &fids) const
 Get all FIDs.
void getLFNs (const std::string &fid, Files &files) const
 Get all logical names for a given FID. Return pairs <LFN,FID>
void getPFNs (const std::string &fid, Files &files) const
 Dump all PFNames of the catalog and their attributes associate to the FileID.
void getFirstPFN (const std::string &fid, std::string &pfn, std::string &tech) const
 Get the first PFN + filetype for the given FID.
void lookupFileByPFN (const std::string &pfn, std::string &fid, std::string &tech) const
 Get FID and filetype for a given PFN.
bool existsPFN (const std::string &pfn) const
 Return the status of a PFName.
std::string lookupPFN (const std::string &pfn) const
 Lookup file identifier by physical file name.
void lookupFileByLFN (const std::string &lfn, std::string &fid) const
 Return the status of a LFName.
std::string lookupLFN (const std::string &lfn) const
void deleteFID (const std::string &FileID)
 Return the status of a FileID.
void deletePFN (const std::string &pfn)
 Delete PFN from the catalog (delete entire FID entry if it was the last PFN)
void registerPFN (const std::string &pfn, const std::string &ftype, std::string &fid)
 Register PFN, assign new FID if not given.
void renamePFN (const std::string &pfn, const std::string &newpfn)
 Rename PFN.
void addReplicaPFN (const std::string &pfn, const std::string &replica_pfn)
 adding replica to an existing PFN
void addReplicaFID (const std::string &fid, const std::string &replica_pfn, const std::string &replica_tech="ROOT_All")
 adding replica to an existing FID
void registerLFN (const std::string &fid, const std::string &lfn) const
 Create a Node for a FileID and DOM Node of the LFN with all the attributes.
void addReadCatalog (const std::string &connect)
 Add new catalog identified by name to the existing ones.
void addCatalog (const std::string &connect)
void removeCatalog (const std::string &connect)
 Add new catalog identified by reference to the existing ones.
Catalogscatalogs ()
 Remove catalog identified by reference from the existing ones.
const Catalogscatalogs () const
 Access catalog container (CONST)
void setWriteCatalog (const std::string &connect)
 Access to the (first) writable file catalog.
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Protected Attributes

SmartIF< Gaudi::IFileCatalogMgr > m_mgr
SmartIF< Gaudi::IFileCatalog > m_fc

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 23 of file IFileCatalog.h.

Member Typedef Documentation

◆ Catalogs

typedef Gaudi::IFileCatalogMgr::Catalogs pool::IFileCatalog::Catalogs

Definition at line 28 of file IFileCatalog.h.

◆ Files

typedef Gaudi::IFileCatalog::Files pool::IFileCatalog::Files

Definition at line 26 of file IFileCatalog.h.

◆ Strings

typedef Gaudi::IFileCatalog::Strings pool::IFileCatalog::Strings

Definition at line 27 of file IFileCatalog.h.

Constructor & Destructor Documentation

◆ IFileCatalog()

pool::IFileCatalog::IFileCatalog ( )

◆ ~IFileCatalog()

pool::IFileCatalog::~IFileCatalog ( )
inline

Definition at line 32 of file IFileCatalog.h.

32{}

Member Function Documentation

◆ addCatalog()

void pool::IFileCatalog::addCatalog ( const std::string & connect)

◆ addReadCatalog()

void pool::IFileCatalog::addReadCatalog ( const std::string & connect)
inline

Add new catalog identified by name to the existing ones.

Definition at line 116 of file IFileCatalog.h.

void addCatalog(const std::string &connect)

◆ addReplicaFID()

void pool::IFileCatalog::addReplicaFID ( const std::string & fid,
const std::string & replica_pfn,
const std::string & replica_tech = "ROOT_All" )

adding replica to an existing FID

◆ addReplicaPFN()

void pool::IFileCatalog::addReplicaPFN ( const std::string & pfn,
const std::string & replica_pfn )

adding replica to an existing PFN

◆ catalogs() [1/2]

Catalogs & pool::IFileCatalog::catalogs ( )
inline

Remove catalog identified by reference from the existing ones.

Access catalog container

Definition at line 128 of file IFileCatalog.h.

128{ return m_mgr->catalogs(); }
SmartIF< Gaudi::IFileCatalogMgr > m_mgr

◆ catalogs() [2/2]

const Catalogs & pool::IFileCatalog::catalogs ( ) const
inline

Access catalog container (CONST)

Definition at line 130 of file IFileCatalog.h.

130{ return m_mgr->catalogs(); }

◆ commit()

void pool::IFileCatalog::commit ( )
inline

Save catalog to file.

Definition at line 49 of file IFileCatalog.h.

49{ m_fc->commit(); }
SmartIF< Gaudi::IFileCatalog > m_fc

◆ connect()

void pool::IFileCatalog::connect ( )
inline

Definition at line 39 of file IFileCatalog.h.

39{ /* not doing anything in Gaudi FC */ }

◆ connectInfo()

const std::string & pool::IFileCatalog::connectInfo ( ) const
inline

Get the connect string.

Definition at line 42 of file IFileCatalog.h.

42{ return m_fc->connectInfo(); }

◆ createFID()

std::string pool::IFileCatalog::createFID ( ) const

Create file identifier using UUID mechanism.

◆ deleteFID()

void pool::IFileCatalog::deleteFID ( const std::string & FileID)
inline

Return the status of a FileID.

Delete FileID Node from the catalog

Definition at line 89 of file IFileCatalog.h.

89{ m_fc->deleteFID(FileID); }
std::string FileID

◆ deletePFN()

void pool::IFileCatalog::deletePFN ( const std::string & pfn)
inline

Delete PFN from the catalog (delete entire FID entry if it was the last PFN)

Definition at line 92 of file IFileCatalog.h.

92{ m_fc->deletePFN(pfn); }

◆ dirty()

bool pool::IFileCatalog::dirty ( ) const
inline

Check if the catalog should be updated.

Definition at line 55 of file IFileCatalog.h.

55{ return m_fc->dirty(); }

◆ disconnect()

void pool::IFileCatalog::disconnect ( )
inline

Definition at line 40 of file IFileCatalog.h.

40{ /* not doing anything in Gaudi FC */ }

◆ existsPFN()

bool pool::IFileCatalog::existsPFN ( const std::string & pfn) const
inline

Return the status of a PFName.

Definition at line 73 of file IFileCatalog.h.

73{ return m_fc->existsPFN(pfn); }

◆ getFIDs()

void pool::IFileCatalog::getFIDs ( Strings & fids) const
inline

Get all FIDs.

Definition at line 58 of file IFileCatalog.h.

58{ m_fc->getFID(fids); }

◆ getFirstPFN()

void pool::IFileCatalog::getFirstPFN ( const std::string & fid,
std::string & pfn,
std::string & tech ) const

Get the first PFN + filetype for the given FID.

◆ getLFNs()

void pool::IFileCatalog::getLFNs ( const std::string & fid,
Files & files ) const
inline

Get all logical names for a given FID. Return pairs <LFN,FID>

Definition at line 61 of file IFileCatalog.h.

61{ m_fc->getLFN(fid, files); }
std::vector< std::string > files
file names and file pointers
Definition hcg.cxx:50

◆ getPFNs()

void pool::IFileCatalog::getPFNs ( const std::string & fid,
Files & files ) const
inline

Dump all PFNames of the catalog and their attributes associate to the FileID.

Definition at line 64 of file IFileCatalog.h.

64{ m_fc->getPFN(fid, files); }

◆ init()

void pool::IFileCatalog::init ( )
inline

Parse the DOM tree of the XML catalog.

Definition at line 47 of file IFileCatalog.h.

47{ m_fc->init(); }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ lookupFileByLFN()

void pool::IFileCatalog::lookupFileByLFN ( const std::string & lfn,
std::string & fid ) const
inline

Return the status of a LFName.

Lookup file identified by logical file name

Definition at line 82 of file IFileCatalog.h.

82{ fid = lookupLFN(lfn); }
std::string lookupLFN(const std::string &lfn) const

◆ lookupFileByPFN()

void pool::IFileCatalog::lookupFileByPFN ( const std::string & pfn,
std::string & fid,
std::string & tech ) const

Get FID and filetype for a given PFN.

◆ lookupLFN()

std::string pool::IFileCatalog::lookupLFN ( const std::string & lfn) const
inline

Definition at line 83 of file IFileCatalog.h.

83{ return m_fc->lookupLFN(lfn); }

◆ lookupPFN()

std::string pool::IFileCatalog::lookupPFN ( const std::string & pfn) const
inline

Lookup file identifier by physical file name.

Definition at line 76 of file IFileCatalog.h.

76{ return m_fc->lookupPFN(pfn); }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ readOnly()

bool pool::IFileCatalog::readOnly ( ) const
inline

Check if the catalog is read-only.

Definition at line 53 of file IFileCatalog.h.

53{ return m_fc->readOnly(); }

◆ registerLFN()

void pool::IFileCatalog::registerLFN ( const std::string & fid,
const std::string & lfn ) const
inline

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

Definition at line 110 of file IFileCatalog.h.

110{ m_fc->registerLFN(fid, lfn ); }

◆ registerPFN()

void pool::IFileCatalog::registerPFN ( const std::string & pfn,
const std::string & ftype,
std::string & fid )

Register PFN, assign new FID if not given.

◆ removeCatalog()

void pool::IFileCatalog::removeCatalog ( const std::string & connect)
inline

Add new catalog identified by reference to the existing ones.

Remove catalog identified by name from the existing ones. * or '' removes all

Definition at line 123 of file IFileCatalog.h.

123{ m_mgr->removeCatalog(connect); }

◆ renamePFN()

void pool::IFileCatalog::renamePFN ( const std::string & pfn,
const std::string & newpfn )
inline

Rename PFN.

Definition at line 98 of file IFileCatalog.h.

98{ m_fc->renamePFN(pfn, newpfn); }

◆ rollback()

void pool::IFileCatalog::rollback ( )
inline

Save catalog to file.

Definition at line 51 of file IFileCatalog.h.

51{ m_fc->rollback(); }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ setWriteCatalog()

void pool::IFileCatalog::setWriteCatalog ( const std::string & connect)

Access to the (first) writable file catalog.

Define the writable catalog identified by reference Define the writable catalog identified by name

◆ start()

void pool::IFileCatalog::start ( )
inline

redirect to init() for Gaudi FC

Definition at line 45 of file IFileCatalog.h.

45{ init(); }
void init()
Parse the DOM tree of the XML catalog.

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_fc

SmartIF<Gaudi::IFileCatalog> pool::IFileCatalog::m_fc
protected

Definition at line 141 of file IFileCatalog.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_mgr

SmartIF<Gaudi::IFileCatalogMgr> pool::IFileCatalog::m_mgr
protected

Definition at line 140 of file IFileCatalog.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


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