ifw-core  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Enumerations | Functions | Variables
ctd::defines Namespace Reference

Typedefs

using IsoTime = std::string
 ISO8601 data type. More...
 

Enumerations

enum  DataType {
  DATA_TYPE_BOOLEAN = 1, DATA_TYPE_INT8 = 2, DATA_TYPE_UINT8 = 4, DATA_TYPE_INT16 = 8,
  DATA_TYPE_UINT16 = 16, DATA_TYPE_INT32 = 32, DATA_TYPE_UINT32 = 64, DATA_TYPE_INT64 = 128,
  DATA_TYPE_UINT64 = 256, DATA_TYPE_FLOAT = 512, DATA_TYPE_DOUBLE = 1024, DATA_TYPE_STRING = 2048,
  DATA_TYPE_NON_BASIC = 4096, DATA_TYPE_TIME_DATE = 8192, DATA_TYPE_TIMESTAMP = 16384, DATA_TYPE_BLOB = 32768,
  DATA_TYPE_ALL, DATA_TYPE_UNKNOWN = 2147483648
}
 Data types numeric representations. More...
 

Functions

std::string GenUniqueId (const std::string &prefix="")
 Generate a unique UUID based ID. A prefix may be prepended, if requested. More...
 
DataType IfwDataTypeToNumeric (const std::string &data_type)
 Data type IFW string representation to IFW numeric representation. More...
 
std::string IfwDataTypeToString (const DataType data_type)
 Data type IFW numeric representation to IFW string representation. More...
 
template<class TYPE >
void CleanVector (const std::vector< TYPE > &vect, const TYPE &pattern, std::vector< TYPE > &clean_vect)
 @ brief STL like list that can be indexed with []'s. More...
 
template<class TYPE >
void CheckRange (const std::string &par, TYPE value, TYPE lower_limit, TYPE upper_limit)
 Check if a value is within a given range. More...
 
template<class TYPE >
void CheckRange (const std::string &par, const TYPE &value, std::vector< TYPE > &valid_values)
 Check if a value is defined in a set. More...
 
template<class TYPE >
std::string DumpVector (const std::vector< TYPE > &vector, const std::string &separator="\n")
 Dump contents of a list into a string buffer. More...
 
template<class MAP_TYPE >
bool ElInMap (const std::string &key, const MAP_TYPE &map)
 Check if a given key is contained in an STL map. More...
 
DataType DataTypeStr2Nb (const std::string &data_type)
 
template<class TYPE >
bool SupportedType (const TYPE &variable)
 Check if the variable has a data type which is supported by the ELT ICS. More...
 

Variables

const std::string EXT_FITS = "fits"
 
const std::string EXT_YAML = "yaml"
 
const std::string EXT_XML = "xml"
 
const std::string EXT_CONFIG = "config"
 
const std::string TRUE_STR = "True"
 
const std::string FALSE_STR = "False"
 
const int64_t NO_TIMEOUT = -1
 
const std::string NO_TIMEOUT_STR = "NoTimeout"
 
const int64_t ERROR = -1
 
const std::string ERROR_STR = "Error"
 
const int64_t ILLEGAL = -3
 
const std::string ILLEGAL_STR = "Illegal"
 
const int64_t INVALID = -4
 
const std::string INVALID_STR = "__INVALID__"
 
const int64_t NOT_IMPLEMENTED = -5
 
const std::string NOT_IMPLEMENTED_STR = "NotImplemented"
 
const int64_t UNDEFINED = -6
 
const std::string UNDEFINED_STR = "__UNDEFINED__"
 
const int64_t UNKNOWN = -7
 
const std::string UNKNOWN_STR = "Unknown"
 
const int64_t FAILURE = -8
 
const std::string FAILURE_STR = "Failure"
 
const int64_t SUCCESS = 0
 
const std::string SUCCESS_STR = "Success"
 
const std::string INDEFINITE_STR = "Indefinite"
 
const std::string ALL_STR = "All"
 
const std::string NONE_STR = "None"
 
const std::string COMPLETED_STR = "Completed"
 
const std::string BUSY_STR = "Busy"
 
const std::string ACTIVE_STR = "Active"
 
const std::string INITIALIZING_STR = "Initializing"
 
const std::string STORING_STR = "Storing"
 
const std::string READING_STR = "Reading"
 
const std::string LOADING_STR = "Loading"
 
const std::string PARSING_STR = "Parsing"
 
const std::string ACQUIRING_STR = "Acquiring"
 
const std::string INSTALLING_STR = "Installing"
 
const std::string ON_STR = "On"
 
const std::string OFF_STR = "Off"
 
const std::string OK_STR = "OK"
 
const std::string NOT_OK_STR = "NOK"
 
const std::string DATA_TYPE_BOOLEAN_STR = "Boolean"
 
const std::string DATA_TYPE_INT8_STR = "Int8"
 
const std::string DATA_TYPE_UINT8_STR = "UInt8"
 
const std::string DATA_TYPE_INT16_STR = "Int16"
 
const std::string DATA_TYPE_UINT16_STR = "UInt16"
 
const std::string DATA_TYPE_INT32_STR = "Int32"
 
const std::string DATA_TYPE_UINT32_STR = "UInt32"
 
const std::string DATA_TYPE_INT64_STR = "Int64"
 
const std::string DATA_TYPE_UINT64_STR = "UInt64"
 
const std::string DATA_TYPE_FLOAT_STR = "Float"
 
const std::string DATA_TYPE_DOUBLE_STR = "Double"
 
const std::string DATA_TYPE_STRING_STR = "String"
 
const std::string DATA_TYPE_NON_BASIC_STR = "NonBasic"
 
const std::string DATA_TYPE_TIME_DATE_STR = "TimeDate"
 
const std::string DATA_TYPE_TIMESTAMP_STR = "TimeStamp"
 
const std::string DATA_TYPE_BLOB_STR = "Blob"
 
const std::string DATA_TYPE_UNKNOWN_STR = "Unknown"
 
const std::map< DataType,
std::string > 
DATA_TYPES_NB_MAP
 Mapping from data type numeric to string representation. More...
 
const std::map< std::string,
DataType
DATA_TYPES_NAME_MAP
 Mapping from data type string to numeric representation. More...
 
const std::map< DataType,
std::string > 
DATA_TYPE_2_TYPE_ID_MAP
 Mapping from IFW numeric data type to system typeid() string representation. More...
 
const std::map< std::string,
DataType
TYPE_ID_2_DATA_TYPE_MAP
 Mapping from system typeid() string representation to IFW numeric data type. More...
 

Typedef Documentation

using ctd::defines::IsoTime = typedef std::string

ISO8601 data type.

Enumeration Type Documentation

Data types numeric representations.

Enumerator
DATA_TYPE_BOOLEAN 
DATA_TYPE_INT8 
DATA_TYPE_UINT8 
DATA_TYPE_INT16 
DATA_TYPE_UINT16 
DATA_TYPE_INT32 
DATA_TYPE_UINT32 
DATA_TYPE_INT64 
DATA_TYPE_UINT64 
DATA_TYPE_FLOAT 
DATA_TYPE_DOUBLE 
DATA_TYPE_STRING 
DATA_TYPE_NON_BASIC 
DATA_TYPE_TIME_DATE 
DATA_TYPE_TIMESTAMP 
DATA_TYPE_BLOB 
DATA_TYPE_ALL 
DATA_TYPE_UNKNOWN 

Function Documentation

template<class TYPE >
void ctd::defines::CheckRange ( const std::string &  par,
TYPE  value,
TYPE  lower_limit,
TYPE  upper_limit 
)

Check if a value is within a given range.

Todo:
: Not yet implemented.
template<class TYPE >
void ctd::defines::CheckRange ( const std::string &  par,
const TYPE &  value,
std::vector< TYPE > &  valid_values 
)

Check if a value is defined in a set.

Todo:
: Not yet implemented.
template<class TYPE >
void ctd::defines::CleanVector ( const std::vector< TYPE > &  vect,
const TYPE &  pattern,
std::vector< TYPE > &  clean_vect 
)

@ brief STL like list that can be indexed with []'s.

Remove elements from list, which are equal to "pattern".

DataType ctd::defines::DataTypeStr2Nb ( const std::string &  data_type)
template<class TYPE >
std::string ctd::defines::DumpVector ( const std::vector< TYPE > &  vector,
const std::string &  separator = "\n" 
)

Dump contents of a list into a string buffer.

template<class MAP_TYPE >
bool ctd::defines::ElInMap ( const std::string &  key,
const MAP_TYPE &  map 
)

Check if a given key is contained in an STL map.

std::string ctd::defines::GenUniqueId ( const std::string &  prefix)

Generate a unique UUID based ID. A prefix may be prepended, if requested.

DataType ctd::defines::IfwDataTypeToNumeric ( const std::string &  data_type)

Data type IFW string representation to IFW numeric representation.

std::string ctd::defines::IfwDataTypeToString ( const DataType  data_type)

Data type IFW numeric representation to IFW string representation.

template<class TYPE >
bool ctd::defines::SupportedType ( const TYPE &  variable)

Check if the variable has a data type which is supported by the ELT ICS.

Variable Documentation

const std::string ctd::defines::ACQUIRING_STR = "Acquiring"
const std::string ctd::defines::ACTIVE_STR = "Active"
const std::string ctd::defines::ALL_STR = "All"
const std::string ctd::defines::BUSY_STR = "Busy"
const std::string ctd::defines::COMPLETED_STR = "Completed"
const std::map<DataType, std::string> ctd::defines::DATA_TYPE_2_TYPE_ID_MAP
Initial value:
= {
{DataType::DATA_TYPE_BOOLEAN, typeid(bool).name()},
{DataType::DATA_TYPE_INT8, typeid(int8_t).name()},
{DataType::DATA_TYPE_UINT8, typeid(uint8_t).name()},
{DataType::DATA_TYPE_INT16, typeid(int16_t).name()},
{DataType::DATA_TYPE_UINT16, typeid(uint16_t).name()},
{DataType::DATA_TYPE_INT32, typeid(int32_t).name()},
{DataType::DATA_TYPE_UINT32, typeid(uint32_t).name()},
{DataType::DATA_TYPE_INT64, typeid(int64_t).name()},
{DataType::DATA_TYPE_UINT64, typeid(uint64_t).name()},
{DataType::DATA_TYPE_FLOAT, typeid(float).name()},
{DataType::DATA_TYPE_DOUBLE, typeid(double).name()},
{DataType::DATA_TYPE_STRING, typeid(std::string).name()}
}
Definition: types.hpp:37
Definition: types.hpp:38
Definition: types.hpp:46
Definition: types.hpp:41
Definition: types.hpp:36
Definition: types.hpp:39
Definition: types.hpp:42
Definition: types.hpp:40
Definition: types.hpp:44
Definition: types.hpp:43
Definition: types.hpp:45
Definition: types.hpp:35

Mapping from IFW numeric data type to system typeid() string representation.

const std::string ctd::defines::DATA_TYPE_BLOB_STR = "Blob"
const std::string ctd::defines::DATA_TYPE_BOOLEAN_STR = "Boolean"
const std::string ctd::defines::DATA_TYPE_DOUBLE_STR = "Double"
const std::string ctd::defines::DATA_TYPE_FLOAT_STR = "Float"
const std::string ctd::defines::DATA_TYPE_INT16_STR = "Int16"
const std::string ctd::defines::DATA_TYPE_INT32_STR = "Int32"
const std::string ctd::defines::DATA_TYPE_INT64_STR = "Int64"
const std::string ctd::defines::DATA_TYPE_INT8_STR = "Int8"
const std::string ctd::defines::DATA_TYPE_NON_BASIC_STR = "NonBasic"
const std::string ctd::defines::DATA_TYPE_STRING_STR = "String"
const std::string ctd::defines::DATA_TYPE_TIME_DATE_STR = "TimeDate"
const std::string ctd::defines::DATA_TYPE_TIMESTAMP_STR = "TimeStamp"
const std::string ctd::defines::DATA_TYPE_UINT16_STR = "UInt16"
const std::string ctd::defines::DATA_TYPE_UINT32_STR = "UInt32"
const std::string ctd::defines::DATA_TYPE_UINT64_STR = "UInt64"
const std::string ctd::defines::DATA_TYPE_UINT8_STR = "UInt8"
const std::string ctd::defines::DATA_TYPE_UNKNOWN_STR = "Unknown"
const std::map<std::string, DataType> ctd::defines::DATA_TYPES_NAME_MAP
Initial value:
= {
}
Definition: types.hpp:37
const std::string DATA_TYPE_NON_BASIC_STR
Definition: types.hpp:72
Definition: types.hpp:38
Definition: types.hpp:46
Definition: types.hpp:49
const std::string DATA_TYPE_BOOLEAN_STR
Definition: types.hpp:60
Definition: types.hpp:41
Definition: types.hpp:36
const std::string DATA_TYPE_UINT8_STR
Definition: types.hpp:62
const std::string DATA_TYPE_INT16_STR
Definition: types.hpp:63
Definition: types.hpp:48
Definition: types.hpp:39
Definition: types.hpp:42
const std::string DATA_TYPE_UINT32_STR
Definition: types.hpp:66
const std::string DATA_TYPE_UINT64_STR
Definition: types.hpp:68
Definition: types.hpp:40
const std::string DATA_TYPE_FLOAT_STR
Definition: types.hpp:69
const std::string DATA_TYPE_UNKNOWN_STR
Definition: types.hpp:76
Definition: types.hpp:44
const std::string DATA_TYPE_INT32_STR
Definition: types.hpp:65
const std::string DATA_TYPE_INT64_STR
Definition: types.hpp:67
Definition: types.hpp:43
Definition: types.hpp:47
const std::string DATA_TYPE_STRING_STR
Definition: types.hpp:71
const std::string DATA_TYPE_INT8_STR
Definition: types.hpp:61
const std::string DATA_TYPE_DOUBLE_STR
Definition: types.hpp:70
Definition: types.hpp:45
const std::string DATA_TYPE_TIMESTAMP_STR
Definition: types.hpp:74
const std::string DATA_TYPE_TIME_DATE_STR
Definition: types.hpp:73
Definition: types.hpp:50
Definition: types.hpp:35
const std::string DATA_TYPE_UINT16_STR
Definition: types.hpp:64
Definition: types.hpp:56
const std::string DATA_TYPE_BLOB_STR
Definition: types.hpp:75

Mapping from data type string to numeric representation.

const std::map<DataType, std::string> ctd::defines::DATA_TYPES_NB_MAP
Initial value:
= {
}
Definition: types.hpp:37
const std::string DATA_TYPE_NON_BASIC_STR
Definition: types.hpp:72
Definition: types.hpp:38
Definition: types.hpp:46
Definition: types.hpp:49
const std::string DATA_TYPE_BOOLEAN_STR
Definition: types.hpp:60
Definition: types.hpp:41
Definition: types.hpp:36
const std::string DATA_TYPE_UINT8_STR
Definition: types.hpp:62
const std::string DATA_TYPE_INT16_STR
Definition: types.hpp:63
Definition: types.hpp:48
Definition: types.hpp:39
Definition: types.hpp:42
const std::string DATA_TYPE_UINT32_STR
Definition: types.hpp:66
const std::string DATA_TYPE_UINT64_STR
Definition: types.hpp:68
Definition: types.hpp:40
const std::string DATA_TYPE_FLOAT_STR
Definition: types.hpp:69
const std::string DATA_TYPE_UNKNOWN_STR
Definition: types.hpp:76
Definition: types.hpp:44
const std::string DATA_TYPE_INT32_STR
Definition: types.hpp:65
const std::string DATA_TYPE_INT64_STR
Definition: types.hpp:67
Definition: types.hpp:43
Definition: types.hpp:47
const std::string DATA_TYPE_STRING_STR
Definition: types.hpp:71
const std::string DATA_TYPE_INT8_STR
Definition: types.hpp:61
const std::string DATA_TYPE_DOUBLE_STR
Definition: types.hpp:70
Definition: types.hpp:45
const std::string DATA_TYPE_TIMESTAMP_STR
Definition: types.hpp:74
const std::string DATA_TYPE_TIME_DATE_STR
Definition: types.hpp:73
Definition: types.hpp:50
Definition: types.hpp:35
const std::string DATA_TYPE_UINT16_STR
Definition: types.hpp:64
Definition: types.hpp:56
const std::string DATA_TYPE_BLOB_STR
Definition: types.hpp:75

Mapping from data type numeric to string representation.

const int64_t ctd::defines::ERROR = -1
const std::string ctd::defines::ERROR_STR = "Error"
const std::string ctd::defines::EXT_CONFIG = "config"
const std::string ctd::defines::EXT_FITS = "fits"
const std::string ctd::defines::EXT_XML = "xml"
const std::string ctd::defines::EXT_YAML = "yaml"
const int64_t ctd::defines::FAILURE = -8
const std::string ctd::defines::FAILURE_STR = "Failure"
const std::string ctd::defines::FALSE_STR = "False"
const int64_t ctd::defines::ILLEGAL = -3
const std::string ctd::defines::ILLEGAL_STR = "Illegal"
const std::string ctd::defines::INDEFINITE_STR = "Indefinite"
const std::string ctd::defines::INITIALIZING_STR = "Initializing"
const std::string ctd::defines::INSTALLING_STR = "Installing"
const int64_t ctd::defines::INVALID = -4
const std::string ctd::defines::INVALID_STR = "__INVALID__"
const std::string ctd::defines::LOADING_STR = "Loading"
const int64_t ctd::defines::NO_TIMEOUT = -1
const std::string ctd::defines::NO_TIMEOUT_STR = "NoTimeout"
const std::string ctd::defines::NONE_STR = "None"
const int64_t ctd::defines::NOT_IMPLEMENTED = -5
const std::string ctd::defines::NOT_IMPLEMENTED_STR = "NotImplemented"
const std::string ctd::defines::NOT_OK_STR = "NOK"
const std::string ctd::defines::OFF_STR = "Off"
const std::string ctd::defines::OK_STR = "OK"
const std::string ctd::defines::ON_STR = "On"
const std::string ctd::defines::PARSING_STR = "Parsing"
const std::string ctd::defines::READING_STR = "Reading"
const std::string ctd::defines::STORING_STR = "Storing"
const int64_t ctd::defines::SUCCESS = 0
const std::string ctd::defines::SUCCESS_STR = "Success"
const std::string ctd::defines::TRUE_STR = "True"
const std::map<std::string, DataType> ctd::defines::TYPE_ID_2_DATA_TYPE_MAP
Initial value:
= {
{typeid(bool).name(), DataType::DATA_TYPE_BOOLEAN},
{typeid(int8_t).name(), DataType::DATA_TYPE_INT8},
{typeid(uint8_t).name(), DataType::DATA_TYPE_UINT8},
{typeid(int16_t).name(), DataType::DATA_TYPE_INT16},
{typeid(uint16_t).name(), DataType::DATA_TYPE_UINT16},
{typeid(int32_t).name(), DataType::DATA_TYPE_INT32},
{typeid(uint32_t).name(), DataType::DATA_TYPE_UINT32},
{typeid(int64_t).name(), DataType::DATA_TYPE_INT64},
{typeid(uint64_t).name(), DataType::DATA_TYPE_UINT64},
{typeid(float).name(), DataType::DATA_TYPE_FLOAT},
{typeid(double).name(), DataType::DATA_TYPE_DOUBLE},
{typeid(std::string).name(), DataType::DATA_TYPE_STRING}
}
Definition: types.hpp:37
Definition: types.hpp:38
Definition: types.hpp:46
Definition: types.hpp:41
Definition: types.hpp:36
Definition: types.hpp:39
Definition: types.hpp:42
Definition: types.hpp:40
Definition: types.hpp:44
Definition: types.hpp:43
Definition: types.hpp:45
Definition: types.hpp:35

Mapping from system typeid() string representation to IFW numeric data type.

const int64_t ctd::defines::UNDEFINED = -6
const std::string ctd::defines::UNDEFINED_STR = "__UNDEFINED__"
const int64_t ctd::defines::UNKNOWN = -7
const std::string ctd::defines::UNKNOWN_STR = "Unknown"