HOPS
HOPS class reference
Public Member Functions | List of all members
hops::MHO_LegacyRootCodeGenerator Class Reference

Class MHO_LegacyRootCodeGenerator. More...

#include <MHO_LegacyRootCodeGenerator.hh>

Public Member Functions

 MHO_LegacyRootCodeGenerator ()
 
virtual ~MHO_LegacyRootCodeGenerator ()
 
std::string GetCode ()
 get a single code corresponding to the current time More...
 
std::vector< std::string > GetCodes (std::size_t N)
 Getter for multiple root codes get a pre-assigned sequential list of N root codes to avoid collisions/duplicates if sub-Delta-T time intervals are encountered when processing a single experiment;. More...
 
std::string root_id (int year, int day, int hour, int min, int sec)
 Calculates and returns a root ID string based on input time parameters. More...
 
std::string root_id_break (time_t now, int year, int day, int hour, int min, int sec)
 Determines and returns root ID based on time parameters and comparison with HOPS_ROOT_BREAK. More...
 
int root_id_delta (time_t now)
 Calculates and returns delta value based on current time comparison with the HOPS_ROOT_BREAK time essentially copied directly from the c utils library, to avoid introducing a library dependency and converted to return a string. More...
 
std::string root_id_later (time_t now)
 Generates a root ID string based on the input time_t value. More...
 

Detailed Description

Class MHO_LegacyRootCodeGenerator.

generate the 6-character timestamp-like root codes for converted filenames

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Wed Apr 27 11:59:40 2022 -0400

Constructor & Destructor Documentation

◆ MHO_LegacyRootCodeGenerator()

hops::MHO_LegacyRootCodeGenerator::MHO_LegacyRootCodeGenerator ( )
inline

◆ ~MHO_LegacyRootCodeGenerator()

virtual hops::MHO_LegacyRootCodeGenerator::~MHO_LegacyRootCodeGenerator ( )
inlinevirtual

Member Function Documentation

◆ GetCode()

std::string hops::MHO_LegacyRootCodeGenerator::GetCode ( )

get a single code corresponding to the current time

Returns
std::string containing the generated code.

◆ GetCodes()

std::vector< std::string > hops::MHO_LegacyRootCodeGenerator::GetCodes ( std::size_t  N)

Getter for multiple root codes get a pre-assigned sequential list of N root codes to avoid collisions/duplicates if sub-Delta-T time intervals are encountered when processing a single experiment;.

Parameters
NNumber of root codes to generate
Returns
Vector of generated root codes as strings

◆ root_id()

std::string hops::MHO_LegacyRootCodeGenerator::root_id ( int  year,
int  day,
int  hour,
int  min,
int  sec 
)

Calculates and returns a root ID string based on input time parameters.

Parameters
value(int)
value2(int)
value3(int)
value4(int)
value5(int)
Returns
A string representing the root ID.

◆ root_id_break()

std::string hops::MHO_LegacyRootCodeGenerator::root_id_break ( time_t  now,
int  year,
int  day,
int  hour,
int  min,
int  sec 
)

Determines and returns root ID based on time parameters and comparison with HOPS_ROOT_BREAK.

Parameters
nowCurrent time in seconds since epoch
yearYear component of time
dayDay of year component of time
hourHour component of time
minMinute component of time
secSecond component of time
Returns
Root ID as a string

◆ root_id_delta()

int hops::MHO_LegacyRootCodeGenerator::root_id_delta ( time_t  now)

Calculates and returns delta value based on current time comparison with the HOPS_ROOT_BREAK time essentially copied directly from the c utils library, to avoid introducing a library dependency and converted to return a string.

Parameters
nowCurrent time in seconds since epoch
Returns
Delta value (4 if now < HOPS_ROOT_BREAK, otherwise 1)

◆ root_id_later()

std::string hops::MHO_LegacyRootCodeGenerator::root_id_later ( time_t  now)

Generates a root ID string based on the input time_t value.

Parameters
nowInput time_t value used to generate the root ID.
Returns
Generated root ID as std::string.

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