ATLAS Offline Software
Loading...
Searching...
No Matches
InsertFileToCatalogApplication Class Reference
Inheritance diagram for InsertFileToCatalogApplication:
Collaboration diagram for InsertFileToCatalogApplication:

Public Member Functions

 InsertFileToCatalogApplication (int argc, char *argv[])
bool parseArguments ()
void execute ()
void printSyntax ()
virtual int run ()
virtual void startSession ATLAS_NOT_THREAD_SAFE ()
virtual void readFileGUIDs ()
virtual std::string readFileGUID (const std::string &pfn)

Static Public Member Functions

static bool initGaudi ()
 initialize the Gaudi framework for standalone executables

Protected Attributes

std::string executableName
std::string technologyName
pool::IStorageSvcstorageSvc = nullptr
std::vector< std::string > args
std::vector< std::string > fileNames
std::vector< std::pair< std::string, std::string > > fidAndPfn

Private Attributes

std::string m_catalogFN

Detailed Description

Definition at line 13 of file pool_insertFileToCatalog.cxx.

Constructor & Destructor Documentation

◆ InsertFileToCatalogApplication()

InsertFileToCatalogApplication::InsertFileToCatalogApplication ( int argc,
char * argv[] )

Definition at line 27 of file pool_insertFileToCatalog.cxx.

28 : SimpleUtilityBase( argc, argv )
29{
30 initGaudi();
31}
static bool initGaudi()
initialize the Gaudi framework for standalone executables
SimpleUtilityBase(int argc=0, char *argv[]=0)
constructor taking commandline parmeters

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

virtual void startSession pool::SimpleUtilityBase::ATLAS_NOT_THREAD_SAFE ( )
virtualinherited

◆ execute()

void InsertFileToCatalogApplication::execute ( )
virtual

Reimplemented from pool::SimpleUtilityBase.

Definition at line 64 of file pool_insertFileToCatalog.cxx.

65{
66 startSession();
68
69 // Open the file catalog and insert the pfn/fid/technology
70 pool::IFileCatalog catalog;
72 catalog.start();
73
74 for( const auto& fp : fidAndPfn ) {
75 std::string fid = fp.first; // can't be const
76 catalog.registerPFN(fp.second, technologyName, fid);
77 }
78 catalog.commit();
79}
void start()
redirect to init() for Gaudi FC
void commit()
Save catalog to file.
void registerPFN(const std::string &pfn, const std::string &ftype, std::string &fid)
Register PFN, assign new FID if not given.
void setWriteCatalog(const std::string &connect)
Establish the writable catalog, identified by name.
virtual void readFileGUIDs()
std::vector< std::pair< std::string, std::string > > fidAndPfn

◆ initGaudi()

bool pool::SimpleUtilityBase::initGaudi ( )
staticinherited

initialize the Gaudi framework for standalone executables

◆ parseArguments()

bool InsertFileToCatalogApplication::parseArguments ( )
virtual

Reimplemented from pool::SimpleUtilityBase.

Definition at line 35 of file pool_insertFileToCatalog.cxx.

36{
37 unsigned int excludedArgument = 0;
38 for ( unsigned int iArg = 0; iArg < args.size(); ++iArg ) {
39 if ( iArg > 0 && iArg == excludedArgument )
40 continue;
41 const std::string& arg = args[iArg];
42 if ( arg == "-u" ) {
43 unsigned int nextArgumentIndex = iArg + 1;
44 if( nextArgumentIndex < args.size() ) {
45 excludedArgument = nextArgumentIndex;
46 m_catalogFN = args[nextArgumentIndex];
47 }
48 }
49 else if( arg == "-t" ) {
50 unsigned int nextArgumentIndex = iArg + 1;
51 if ( nextArgumentIndex < args.size() ) {
52 excludedArgument = nextArgumentIndex;
53 technologyName = args[nextArgumentIndex];
54 }
55 }
56 else {
57 fileNames.push_back( arg );
58 }
59 }
61}
std::vector< std::string > fileNames
std::vector< std::string > args
virtual bool parseArguments()

◆ printSyntax()

void InsertFileToCatalogApplication::printSyntax ( )
virtual

Reimplemented from pool::SimpleUtilityBase.

Definition at line 83 of file pool_insertFileToCatalog.cxx.

84{
85 std::cout << "Syntax : " << executableName << " [-u fileCatalog] [-t technologyType] files" << std::endl;
86}

◆ readFileGUID()

virtual std::string pool::SimpleUtilityBase::readFileGUID ( const std::string & pfn)
virtualinherited

◆ readFileGUIDs()

virtual void pool::SimpleUtilityBase::readFileGUIDs ( )
virtualinherited

◆ run()

virtual int pool::SimpleUtilityBase::run ( )
virtualinherited

Member Data Documentation

◆ args

std::vector< std::string > pool::SimpleUtilityBase::args
protectedinherited

Definition at line 47 of file SimpleUtilityBase.h.

◆ executableName

std::string pool::SimpleUtilityBase::executableName
protectedinherited

Definition at line 43 of file SimpleUtilityBase.h.

◆ fidAndPfn

std::vector< std::pair< std::string, std::string > > pool::SimpleUtilityBase::fidAndPfn
protectedinherited

Definition at line 49 of file SimpleUtilityBase.h.

◆ fileNames

std::vector< std::string > pool::SimpleUtilityBase::fileNames
protectedinherited

Definition at line 48 of file SimpleUtilityBase.h.

◆ m_catalogFN

std::string InsertFileToCatalogApplication::m_catalogFN
private

Definition at line 22 of file pool_insertFileToCatalog.cxx.

◆ storageSvc

pool::IStorageSvc* pool::SimpleUtilityBase::storageSvc = nullptr
protectedinherited

Definition at line 45 of file SimpleUtilityBase.h.

◆ technologyName

std::string pool::SimpleUtilityBase::technologyName
protectedinherited

Definition at line 44 of file SimpleUtilityBase.h.


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