ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
dqi::HanRuntimeConfigSingleton Class Reference

#include <HanRuntimeConfigSingleton.h>

Collaboration diagram for dqi::HanRuntimeConfigSingleton:

Public Member Functions

ATLAS_NOT_THREAD_SAFE void setPath (const std::string &path)
 
constexpr const std::string & getPath () const
 
constexpr bool pathIsRunDirectory () const
 
constexpr uint32_t getPathRunNumber () const
 

Static Public Member Functions

static HanRuntimeConfigSingletongetInstance ()
 

Private Member Functions

 HanRuntimeConfigSingleton ()=default
 
 ~HanRuntimeConfigSingleton ()=default
 
 HanRuntimeConfigSingleton (const HanRuntimeConfigSingleton &)=delete
 
HanRuntimeConfigSingletonoperator= (const HanRuntimeConfigSingleton &)=delete
 
 HanRuntimeConfigSingleton (HanRuntimeConfigSingleton &&)=delete
 
HanRuntimeConfigSingletonoperator= (HanRuntimeConfigSingleton &&)=delete
 
ATLAS_NOT_THREAD_SAFE void parsePathRunNumber ()
 

Private Attributes

std::string m_path
 
uint32_t m_runNumber = 0
 

Detailed Description

Definition at line 14 of file HanRuntimeConfigSingleton.h.

Constructor & Destructor Documentation

◆ HanRuntimeConfigSingleton() [1/3]

dqi::HanRuntimeConfigSingleton::HanRuntimeConfigSingleton ( )
privatedefault

◆ ~HanRuntimeConfigSingleton()

dqi::HanRuntimeConfigSingleton::~HanRuntimeConfigSingleton ( )
privatedefault

◆ HanRuntimeConfigSingleton() [2/3]

dqi::HanRuntimeConfigSingleton::HanRuntimeConfigSingleton ( const HanRuntimeConfigSingleton )
privatedelete

◆ HanRuntimeConfigSingleton() [3/3]

dqi::HanRuntimeConfigSingleton::HanRuntimeConfigSingleton ( HanRuntimeConfigSingleton &&  )
privatedelete

Member Function Documentation

◆ getInstance()

HanRuntimeConfigSingleton & dqi::HanRuntimeConfigSingleton::getInstance ( )
static

Definition at line 14 of file HanRuntimeConfigSingleton.cxx.

16  {
17  //Thread safe according to:
18  // - paragraph 6.7.4 of C++11 and C++14 standards
19  // - paragraph 9.7.4 of C++17 standard
20  // - paragraph 8.8.4 of C++20 standard
22  return instance;
23  }

◆ getPath()

constexpr const std::string& dqi::HanRuntimeConfigSingleton::getPath ( ) const
inlineconstexpr

Definition at line 21 of file HanRuntimeConfigSingleton.h.

21 { return m_path; }

◆ getPathRunNumber()

constexpr uint32_t dqi::HanRuntimeConfigSingleton::getPathRunNumber ( ) const
inlineconstexpr

Definition at line 23 of file HanRuntimeConfigSingleton.h.

23 { return m_runNumber; }

◆ operator=() [1/2]

HanRuntimeConfigSingleton& dqi::HanRuntimeConfigSingleton::operator= ( const HanRuntimeConfigSingleton )
privatedelete

◆ operator=() [2/2]

HanRuntimeConfigSingleton& dqi::HanRuntimeConfigSingleton::operator= ( HanRuntimeConfigSingleton &&  )
privatedelete

◆ parsePathRunNumber()

void dqi::HanRuntimeConfigSingleton::parsePathRunNumber ( )
private

Definition at line 26 of file HanRuntimeConfigSingleton.cxx.

28  {
29  std::string_view path = m_path;
30  while ( !path.empty() && path.front() == '/' ) path.remove_prefix( 1 );
31  while ( !path.empty() && path.back() == '/' ) path.remove_suffix( 1 );
32  if ( path.empty() ) return;
33 
34  using std::operator""sv;
35  // Replace by starts_with in C++20
36  if ( path.substr( 0, 4 ) != "run_"sv ) return;
37  path.remove_prefix( 4 );
38  auto begin = path.data();
39  auto end = begin + path.size();
40  auto [ptr, err] = std::from_chars( begin, end, m_runNumber );
41  if ( err != std::errc() && ptr != end ) m_runNumber = 0;
42  }

◆ pathIsRunDirectory()

constexpr bool dqi::HanRuntimeConfigSingleton::pathIsRunDirectory ( ) const
inlineconstexpr

Definition at line 22 of file HanRuntimeConfigSingleton.h.

22 { return m_runNumber > 0; }

◆ setPath()

ATLAS_NOT_THREAD_SAFE void dqi::HanRuntimeConfigSingleton::setPath ( const std::string &  path)
inline

Definition at line 20 of file HanRuntimeConfigSingleton.h.

Member Data Documentation

◆ m_path

std::string dqi::HanRuntimeConfigSingleton::m_path
private

Definition at line 36 of file HanRuntimeConfigSingleton.h.

◆ m_runNumber

uint32_t dqi::HanRuntimeConfigSingleton::m_runNumber = 0
private

Definition at line 37 of file HanRuntimeConfigSingleton.h.


The documentation for this class was generated from the following files:
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
dqi::HanRuntimeConfigSingleton::HanRuntimeConfigSingleton
HanRuntimeConfigSingleton()=default
dqi::HanRuntimeConfigSingleton::m_runNumber
uint32_t m_runNumber
Definition: HanRuntimeConfigSingleton.h:37
LArCellConditions.sv
bool sv
Definition: LArCellConditions.py:45
dqi::HanRuntimeConfigSingleton::m_path
std::string m_path
Definition: HanRuntimeConfigSingleton.h:36
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
dqi::HanRuntimeConfigSingleton::parsePathRunNumber
ATLAS_NOT_THREAD_SAFE void parsePathRunNumber()
Definition: HanRuntimeConfigSingleton.cxx:27