Belle II Software  release-08-01-10
MetadataService Class Reference

This class provides a service for writing metadata about the basf2 execution and about output files to a json file. More...

#include <MetadataService.h>

Collaboration diagram for MetadataService:

Public Member Functions

void setJsonFileName (const std::string &fileName)
 Set the name of the json metadata file. More...
 
void addRootOutputFile (const std::string &fileName, const FileMetaData *metaData=nullptr)
 Add the metadata of a root output file.
 
void addRootNtupleFile (const std::string &fileName)
 Add the metadata of a root ntuple file.
 
void addHDF5File (const std::string &fileName)
 Add the metadata of a HDF5 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 MetadataServiceInstance ()
 Static method to get a reference to the MetadataService instance. More...
 

Private Member Functions

 MetadataService ()
 Constructor.
 
 MetadataService (const MetadataService &)=delete
 Disable/Hide the copy constructor.
 
MetadataServiceoperator= (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
 

Detailed Description

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.

Member Function Documentation

◆ Instance()

MetadataService & Instance ( )
static

Static method to get a reference to the MetadataService instance.

Returns
A reference to an instance of this class.

Definition at line 26 of file MetadataService.cc.

27 {
28  static MetadataService instance;
29  return instance;
30 }
This class provides a service for writing metadata about the basf2 execution and about output files t...

◆ setJsonFileName()

void setJsonFileName ( const std::string &  fileName)
inline

Set the name of the json metadata file.

Parameters
fileNamename of the json file

Definition at line 43 of file MetadataService.h.

43 {m_fileName = fileName; writeJson();};
void writeJson()
Serialize the current json content to the json file.
std::string m_fileName
The name of the json file.

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