Belle II Software development
|
This class provides a service for writing metadata about the basf2 execution and about output files to a json file. More...
#include <MetadataService.h>
Public Member Functions | |
void | setJsonFileName (const std::string &fileName) |
Set the name of the json metadata file. | |
void | addRootOutputFile (const std::string &fileName, const FileMetaData *metaData=nullptr) |
Add the metadata of a root output file. | |
void | addNtuple (const std::string &fileName) |
Add the metadata of any ntuple file. | |
void | addBasf2Status (const std::string &message="") |
Add metadata of basf2 status. | |
void | addModuleCallsCount () |
Add the metadata of number of calls of all modules. | |
void | finishBasf2 (bool success=true) |
Add metadata for basf2 completion. | |
Static Public Member Functions | |
static MetadataService & | Instance () |
Static method to get a reference to the MetadataService instance. | |
Private Member Functions | |
MetadataService () | |
Constructor. | |
MetadataService (const MetadataService &)=delete | |
Disable/Hide the copy constructor. | |
MetadataService & | operator= (const MetadataService &)=delete |
Disable/Hide the copy assignment operator. | |
void | writeJson () |
Serialize the current json content to the json file. | |
Private Attributes | |
std::string | m_fileName |
The name of the json file. | |
nlohmann::json | m_json |
The json object. | |
double | m_basf2StartTime |
the start time of basf2 | |
This class provides a service for writing metadata about the basf2 execution and about output files to a json file.
Definition at line 27 of file MetadataService.h.
|
private |
Constructor.
Definition at line 21 of file MetadataService.cc.
void addBasf2Status | ( | const std::string & | message = "" | ) |
Add metadata of basf2 status.
Definition at line 75 of file MetadataService.cc.
void addModuleCallsCount | ( | ) |
Add the metadata of number of calls of all modules.
Definition at line 99 of file MetadataService.cc.
void addNtuple | ( | const std::string & | fileName | ) |
Add the metadata of any ntuple file.
Definition at line 57 of file MetadataService.cc.
void addRootOutputFile | ( | const std::string & | fileName, |
const FileMetaData * | metaData = nullptr |
||
) |
Add the metadata of a root output file.
Definition at line 32 of file MetadataService.cc.
void finishBasf2 | ( | bool | success = true | ) |
Add metadata for basf2 completion.
Definition at line 118 of file MetadataService.cc.
|
static |
Static method to get a reference to the MetadataService instance.
Definition at line 26 of file MetadataService.cc.
|
inline |
Set the name of the json metadata file.
fileName | name of the json file |
Definition at line 43 of file MetadataService.h.
|
private |
Serialize the current json content to the json file.
Definition at line 126 of file MetadataService.cc.
|
private |
the start time of basf2
Definition at line 74 of file MetadataService.h.
|
private |
The name of the json file.
Definition at line 72 of file MetadataService.h.
|
private |
The json object.
Definition at line 73 of file MetadataService.h.