![]() |
Project
|
Namespaces | |
namespace | test |
Classes | |
struct | DataPointCompositeObject |
class | DataPointIdentifier |
struct | DataPointValue |
class | DCSConfigConsumer |
class | DCSConsumer |
struct | DPIDHash |
class | RunStatusChecker |
Typedefs | |
typedef std::vector< char > | DCSconfigObject_t |
using | DPID = o2::dcs::DataPointIdentifier |
using | DPVAL = o2::dcs::DataPointValue |
using | DPCOM = o2::dcs::DataPointCompositeObject |
Enumerations | |
enum | DeliveryType { VOID = 0 , RAW_BINARY = 64 , DPVAL_BINARY = 192 , RAW_INT = 21 , DPVAL_INT = 149 , RAW_UINT = 20 , DPVAL_UINT = 148 , RAW_DOUBLE = 22 , DPVAL_DOUBLE = 150 , RAW_FLOAT = 28 , DPVAL_FLOAT = 156 , RAW_BOOL = 23 , DPVAL_BOOL = 151 , RAW_CHAR = 19 , DPVAL_CHAR = 147 , RAW_STRING = 25 , DPVAL_STRING = 153 , RAW_TIME = 4 , DPVAL_TIME = 132 } |
Functions | |
template<typename T > | |
void | addConfigItem (DCSconfigObject_t &configVector, std::string key, const T value) |
template<> | |
void | addConfigItem (DCSconfigObject_t &configVector, std::string key, const std::string value) |
template<> | |
void | addConfigItem (DCSconfigObject_t &configVector, std::string key, const char value) |
template<> | |
void | addConfigItem (DCSconfigObject_t &configVector, std::string key, const char *value) |
template<> | |
void | addConfigItem (DCSconfigObject_t &configVector, std::string key, const TString value) |
void | printDCSConfig (const DCSconfigObject_t &configVector) |
std::vector< std::string > | expandAlias (const std::string &pattern) |
std::vector< std::string > | expandAliases (const std::vector< std::string > &patternedAliases) |
uint64_t | time_since (const std::chrono::steady_clock::time_point beginning) noexcept |
uint64_t | epoch_time () noexcept |
uint64_t | now () noexcept |
std::string | timestamp () noexcept |
std::string | timestamp (const std::string &format) noexcept |
std::string | fs_timestamp () noexcept |
template<typename T > | |
T | getValue (const DataPointCompositeObject &dpcom) |
template<typename T > | |
o2::dcs::DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, T val, uint32_t seconds, uint16_t msec, uint16_t flags=0) |
template<typename T > | |
std::vector< DataPointCompositeObject > | generateRandomDataPoints (const std::vector< std::string > &aliases, T min, T max, std::string refDate="") |
template<> | |
DeliveryType | read (const std::string &str) |
template<> | |
std::string | show (const DeliveryType type) |
bool | DPVAL_variant (const DeliveryType type) |
std::string | dim_description (const DeliveryType type) |
size_t | dim_buffer_size (const DeliveryType type) |
template<typename T > | |
std::string | show (const T input) |
template<typename T > | |
T | read (const std::string &input) |
std::string | random_string (const size_t length) noexcept |
std::string | random_string2 (const size_t length) noexcept |
uint64_t | hash_code (const std::string &input) noexcept |
std::unique_ptr< std::vector< std::string > > | convert_strings (const int argc, char **argv) noexcept |
void | to_upper_case (std::string &str) noexcept |
void | to_lower_case (std::string &str) noexcept |
std::unique_ptr< std::vector< std::string > > | split (const std::string &source, const char separator) noexcept |
std::unique_ptr< std::vector< std::string > > | split_by_whitespace (const std::string &source) noexcept |
std::string | to_hex_big_endian (const char *const start, size_t length) noexcept |
std::string | to_hex_little_endian (const char *const start, size_t length) noexcept |
void | print_k_v_list (const std::string &list_name, const std::list< std::pair< std::string, std::string > > ¶meters) noexcept |
template<typename T , o2::dcs::DeliveryType dt> | |
T | getValueImpl (const DataPointCompositeObject &dpcom) |
template<> | |
double | getValue (const DataPointCompositeObject &dpcom) |
template<> | |
float | getValue (const DataPointCompositeObject &dpcom) |
template<> | |
uint32_t | getValue (const DataPointCompositeObject &dpcom) |
template<> | |
int32_t | getValue (const DataPointCompositeObject &dpcom) |
template<> | |
char | getValue (const DataPointCompositeObject &dpcom) |
template<> | |
bool | getValue (const DataPointCompositeObject &dpcom) |
template<> | |
std::string | getValue (const DataPointCompositeObject &dpcom) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, double val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, float val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, int32_t val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, uint32_t val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, long long val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, char val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, bool val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<> | |
DataPointCompositeObject | createDataPointCompositeObject (const std::string &alias, std::string val, uint32_t seconds, uint16_t msec, uint16_t flags) |
template<typename T > | |
std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints (const std::vector< std::string > &aliases, T minValue, T maxValue, std::string refDate) |
template std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< double > (const std::vector< std::string > &aliases, double minValue, double maxValue, std::string) |
template std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< float > (const std::vector< std::string > &aliases, float minValue, float maxValue, std::string) |
template std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< uint32_t > (const std::vector< std::string > &aliases, uint32_t minValue, uint32_t maxValue, std::string) |
template std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< int32_t > (const std::vector< std::string > &aliases, int32_t minValue, int32_t maxValue, std::string) |
template std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< long long > (const std::vector< std::string > &aliases, long long minValue, long long maxValue, std::string) |
template std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< char > (const std::vector< std::string > &aliases, char minValue, char maxValue, std::string) |
template<> | |
std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< bool > (const std::vector< std::string > &aliases, bool minValue, bool maxValue, std::string refDate) |
template<> | |
std::vector< o2::dcs::DataPointCompositeObject > | generateRandomDataPoints< std::string > (const std::vector< std::string > &aliases, std::string minLength, std::string maxLength, std::string refDate) |
o2f::InjectorFunction | dcs2dpl (std::unordered_map< DPID, std::vector< o2h::DataDescription > > &dpid2group, bool fbiFirst, bool verbose=false, int FBIPerInterval=1) |
typedef std::vector<char> o2::dcs::DCSconfigObject_t |
Definition at line 28 of file DCSConfigObject.h.
using o2::dcs::DPCOM = typedef o2::dcs::DataPointCompositeObject |
Definition at line 48 of file DCStoDPLconverter.h.
using o2::dcs::DPID = typedef o2::dcs::DataPointIdentifier |
Definition at line 46 of file DCStoDPLconverter.h.
using o2::dcs::DPVAL = typedef o2::dcs::DataPointValue |
Definition at line 47 of file DCStoDPLconverter.h.
DeliveryType is a piece of meta-information used for deducing types of DPVAL payloads and DIM service description strings used with services providing data to ADAPOS. DPCOMs use the DeliveryType of DPIDs to infer the correct interpretation of payload data when being put into a std::ofstream
. Also, ADAPOS Engine uses DeliveryTypes for DIM service subscription (and Load Generator for generating services).
Every DeliveryType, except VOID
, has a raw and DPVAL variant. A DIM service publishing payloads in DPVALs has a different format and binary layout than a DIM service publishing only raw data, so this distinction is critical to ADAPOS Engine.
Definition at line 45 of file DeliveryType.h.
|
inline |
Definition at line 55 of file DCSConfigObject.h.
|
inline |
Definition at line 47 of file DCSConfigObject.h.
|
inline |
Definition at line 39 of file DCSConfigObject.h.
|
inline |
Definition at line 31 of file DCSConfigObject.h.
|
inline |
Definition at line 63 of file DCSConfigObject.h.
Converts the C-style strings of the command line parameters to a more civilized data type.
Definition at line 237 of file StringUtils.cxx.
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
bool | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 74 of file DataPointCreator.cxx.
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
char | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 68 of file DataPointCreator.cxx.
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
double | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 32 of file DataPointCreator.cxx.
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
float | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 38 of file DataPointCreator.cxx.
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
int32_t | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 47 of file DataPointCreator.cxx.
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
long long | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 61 of file DataPointCreator.cxx.
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
std::string | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 81 of file DataPointCreator.cxx.
o2::dcs::DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
T | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags = 0 |
||
) |
createDataPointCompositeObject is a convenience function to simplify the creation of a DataPointCompositeObject.
alias | the DataPoint alias name (max 56 characters) |
val | the value of the datapoint |
flags | value for ADAPOS flags. |
milliseconds | value for milliseconds. |
seconds | value for seconds. |
The actual DeliveryType of the returned DataPointCompositeObject is deduced from the type of val.
Note that only a few relevant specialization are actually provided
DataPointCompositeObject o2::dcs::createDataPointCompositeObject | ( | const std::string & | alias, |
uint32_t | val, | ||
uint32_t | seconds, | ||
uint16_t | msec, | ||
uint16_t | flags | ||
) |
Definition at line 54 of file DataPointCreator.cxx.
o2f::InjectorFunction o2::dcs::dcs2dpl | ( | std::unordered_map< DPID, std::vector< o2h::DataDescription > > & | dpid2group, |
bool | fbiFirst, | ||
bool | verbose = false , |
||
int | FBIPerInterval = 1 |
||
) |
A callback function to retrieve the FairMQChannel name to be used for sending messages of the specified OutputSpec
Definition at line 53 of file DCStoDPLconverter.h.
|
inline |
Returns the size of a buffer required to store the binary contents of a DIM service of the given data type.
type | The DeliveryType. |
std::domain_error | If applied to an invalid value. |
Definition at line 369 of file DeliveryType.h.
|
inline |
Returns the DIM description string for a DIM service with the given DeliveryType.
type | The DeliveryType. |
std::domain_error | If applied to an invalid value. |
Definition at line 315 of file DeliveryType.h.
|
inline |
Returns true
if and only if the given DeliveryType is a DPVAL variant.
type | The DeliveryType to be checked. |
std::domain_error | If applied to an invalid value. |
Definition at line 278 of file DeliveryType.h.
|
inlinenoexcept |
std::vector< std::string > o2::dcs::expandAlias | ( | const std::string & | pattern | ) |
expandAlias converts a single pattern into a list of strings.
pattern | a pattern is made of a number of "XX[YY]" blocks (at least one) |
where :
An integral range is [a..b] where the formatting of the biggest of the two integers a and b dictates, by default, the formatting of the output alias. For instance [0..3] is expanded to the set 0,1,2,3 while [00..03] is expanded to 00,01,02,03. If you want more control on the formatting, you can use a python/fmt format {} e.g. [0..15{:d}] would yields 0,1, 2,...,14,15 simply (no 0 filling).
A textual list is simply a list of values separated by commas, e.g. "vMon,iMon"
For example, pattern=DET[A,B]/Channel[000,002]/[iMon,vMon] yields :
Definition at line 94 of file AliasExpander.cxx.
std::vector< std::string > o2::dcs::expandAliases | ( | const std::vector< std::string > & | patternedAliases | ) |
expandAliases converts a list of patterns into a list of strings.
each input pattern is treated by expandAlias()
Definition at line 134 of file AliasExpander.cxx.
|
inlinenoexcept |
Generates a simple timestamp usable file paths. This function is like ADAPRO::Control::timestamp
, but with spaces replaced with underscores and colons with dots in order to ensure compatibility with (Linux) filesystems. This function uses local timezone.
YYYY-MM-DD_HH.MM.SS
). Every decimal number in the date string has leading zeros and therefore fixed length. std::vector< DataPointCompositeObject > o2::dcs::generateRandomDataPoints | ( | const std::vector< std::string > & | aliases, |
T | min, | ||
T | max, | ||
std::string | refDate = "" |
||
) |
Generate random data points, uniformly distributed between two values.
T | the type of value of the data points to be generated. Only a few types are supported : double, float, uint32_t, int32_t, char, bool |
aliases | the list of aliases to be generated. Those can use patterns that will be expanded, |
minValue | the minimum value of the values to be generated |
maxValue | the maximum value of the values to be generated |
refDate | the date to be associated with all data points in Y-b-d H:M:S format. If refDate="" the current date is used. |
Definition at line 70 of file DataPointGenerator.cxx.
std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints | ( | const std::vector< std::string > & | aliases, |
T | min, | ||
T | max, | ||
std::string | refDate = "" |
||
) |
Generate random data points, uniformly distributed between two values.
T | the type of value of the data points to be generated. Only a few types are supported : double, float, uint32_t, int32_t, char, bool |
aliases | the list of aliases to be generated. Those can use patterns that will be expanded, |
minValue | the minimum value of the values to be generated |
maxValue | the maximum value of the values to be generated |
refDate | the date to be associated with all data points in Y-b-d H:M:S format. If refDate="" the current date is used. |
Definition at line 70 of file DataPointGenerator.cxx.
std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< bool > | ( | const std::vector< std::string > & | aliases, |
bool | minValue, | ||
bool | maxValue, | ||
std::string | refDate | ||
) |
Need a specific specialization for bool as got into trouble compiling uniform_int_distribution<bool> on some platform (e.g. CC7).
Definition at line 110 of file DataPointGenerator.cxx.
template std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< char > | ( | const std::vector< std::string > & | aliases, |
char | minValue, | ||
char | maxValue, | ||
std::string | |||
) |
template std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< double > | ( | const std::vector< std::string > & | aliases, |
double | minValue, | ||
double | maxValue, | ||
std::string | |||
) |
template std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< float > | ( | const std::vector< std::string > & | aliases, |
float | minValue, | ||
float | maxValue, | ||
std::string | |||
) |
template std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< int32_t > | ( | const std::vector< std::string > & | aliases, |
int32_t | minValue, | ||
int32_t | maxValue, | ||
std::string | |||
) |
template std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< long long > | ( | const std::vector< std::string > & | aliases, |
long long | minValue, | ||
long long | maxValue, | ||
std::string | |||
) |
std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< std::string > | ( | const std::vector< std::string > & | aliases, |
std::string | minLength, | ||
std::string | maxLength, | ||
std::string | refDate | ||
) |
Generate data points of type string, where each string is random, with a length between the length of the two input strings (minLength,maxLength)
Definition at line 110 of file DataPointGenerator.cxx.
template std::vector< o2::dcs::DataPointCompositeObject > o2::dcs::generateRandomDataPoints< uint32_t > | ( | const std::vector< std::string > & | aliases, |
uint32_t | minValue, | ||
uint32_t | maxValue, | ||
std::string | |||
) |
T o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Return the value contained in the DataPointCompositeObject, if possible.
T | the expected type of the value |
dpcom | the DataPointCompositeObject the value is extracted from |
if | the DeliveryType of the data point is not compatible with T |
double o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 48 of file DataPointCompositeObject.cxx.
float o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 54 of file DataPointCompositeObject.cxx.
uint32_t o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 60 of file DataPointCompositeObject.cxx.
int32_t o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 66 of file DataPointCompositeObject.cxx.
char o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 72 of file DataPointCompositeObject.cxx.
bool o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 78 of file DataPointCompositeObject.cxx.
std::string o2::dcs::getValue | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 84 of file DataPointCompositeObject.cxx.
T o2::dcs::getValueImpl | ( | const DataPointCompositeObject & | dpcom | ) |
Definition at line 22 of file DataPointCompositeObject.cxx.
|
noexcept |
Calculates a hash code for the given string. Up to 52 first characters of the string contribute to the hash code. The hash code is case insensitive, so for example "abc"
and "ABC"
will have colliding hash codes.
input | A string. |
Definition at line 225 of file StringUtils.cxx.
|
inlinenoexcept |
|
noexcept |
Prints the given list of key-value pairs.
logger | The Logger instance used for output. |
list_name | Name of the list to be printed as a heading. |
parameters | The list to be printed |
|
inline |
Definition at line 69 of file DCSConfigObject.h.
|
noexcept |
Returns an uniformly distributed string of exactly the given length. The alphabet of the string is ASCII characters between 32
(' '
) and 126
('~'
), inclusive.
length | Length for the random string. |
Definition at line 205 of file StringUtils.cxx.
|
noexcept |
Returns a random string of exactly the given length. The alphabet for the string contains upper case letters, digits and the symbols '_'
, '/'
, and '?'
. Their distribution is geometric and tries to roughly approximate the symbol frequencies in ALICE DCS DIM service aliases.
length | Length for the random string. |
Definition at line 215 of file StringUtils.cxx.
T o2::dcs::read | ( | const std::string & | input | ) |
This function template is used for parsing strings as ADAPRO enumerated values. The exact implementation depends on the specialization.
input | A string to be interpreted as a T value. |
std::domain_error | The specialized function may throw a domain error if the given string couldn't be converted into a T value. |
|
inline |
Definition at line 177 of file DeliveryType.h.
|
inline |
Definition at line 224 of file DeliveryType.h.
std::string o2::dcs::show | ( | const T | input | ) |
This function template is used for converting ADAPRO enumerated values into strings in a fashion similar to the function show in the Show type class in Haskell. The exact implementation depends on the specialization.
input | A T value to be converted. |
std::domain_error | The specialized function may throw a domain error if applied with an invalid input value. |
|
noexcept |
Splits a string using the given separator.
source | The string to be splitted. |
separator | The delimiting character. |
Definition at line 249 of file StringUtils.cxx.
|
noexcept |
Splits a string using whitespace as separator. Only the non-whitespace substrings will be returned.
source | The string to be splitted. |
Definition at line 261 of file StringUtils.cxx.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a timestamp of the current point of time in the local timezone. The format of the timestamp is specified with the parameter format
. The format of the format string is the same as is used by std::strftime
.
format
. Returns a simple big endian hexadecimal presentation of the given segment of memory.
start | Address of a memory segment. |
length | Length of the memory segment. |
Definition at line 327 of file StringUtils.cxx.
Returns a simple little endian hexadecimal presentation of the given segment of memory.
start | Address of a memory segment. |
length | Length of the memory segment (in chars). |
Definition at line 344 of file StringUtils.cxx.
|
inlinenoexcept |
Converts the given string into lower case. This function will change the state of the given string, instead of returning a copy.
str | The string to be converted into lower case. |
Definition at line 93 of file StringUtils.h.
|
inlinenoexcept |
Converts the given string into upper case. This function will change the state of the given string, instead of returning a copy.
str | The string to be converted into upper case. |
Definition at line 80 of file StringUtils.h.