Belle II Software  release-05-02-19
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 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 37 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 28 of file MetadataService.cc.

29 {
30  static MetadataService instance;
31  return instance;
32 }

◆ 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 53 of file MetadataService.h.


The documentation for this class was generated from the following files:
Belle2::MetadataService
This class provides a service for writing metadata about the basf2 execution and about output files t...
Definition: MetadataService.h:37