ifw-core 7.0.0
 
Loading...
Searching...
No Matches
ifw::core::utils::base Namespace Reference

Namespaces

namespace  testutils
 

Functions

void InstallFndLog4cplusBridge (const std::string &logger_name)
 Install the FND->log4cplus bridge as the process-wide ifw-fnd logger. Bridged FND* output goes to the log4cplus logger named logger_name (configure it in log.properties). Idempotent: does nothing if an ifw-fnd logger is already installed. Call once at startup, before anything logs via FND*.
 
log4cplus::Logger & Logger ()
 
std::string ResolvePath (const std::string &filename)
 Resolve the filename if it contains env. variables, "~" and relative paths.
 
std::string GenUniqueId (const std::string &prefix="")
 Generate a unique UUID based ID. A prefix may be prepended, if requested.
 
template<class TYPE>
void CleanVector (const std::vector< TYPE > &vect, const TYPE &pattern, std::vector< TYPE > &clean_vect)
 Remove elements from list, which are equal to "pattern".
 
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.
 
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.
 
template<class TYPE>
int32_t ElInVector (const std::vector< TYPE > &vect, const TYPE &value)
 Check for specific element in the list. Return index if found, otherwise -1.
 
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.
 
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.
 

Variables

const std::string SYSROOT = "SYSROOT"
 
const std::string INTROOT = "INTROOT"
 
const std::string DATAROOT = "DATAROOT"
 
const std::string CFGPATH = "CFGPATH"
 
const std::string EXT_FITS = "fits"
 
const int64_t NO_TIMEOUT = -1
 
const std::string INVALID = "__INVALID__"
 
const std::string NOT_IMPLEMENTED = "NotImplemented"
 
const std::string UNDEFINED = "__UNDEFINED__"
 
const int64_t FAILURE = 1
 
const int64_t SUCCESS = 0
 

Function Documentation

◆ CheckRange() [1/2]

template<class TYPE>
void ifw::core::utils::base::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.

◆ CheckRange() [2/2]

template<class TYPE>
void ifw::core::utils::base::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.

◆ CleanVector()

template<class TYPE>
void ifw::core::utils::base::CleanVector ( const std::vector< TYPE > & vect,
const TYPE & pattern,
std::vector< TYPE > & clean_vect )

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

◆ DumpVector()

template<class TYPE>
std::string ifw::core::utils::base::DumpVector ( const std::vector< TYPE > & vector,
const std::string & separator = "\n" )

Dump contents of a list into a string buffer.

◆ ElInMap()

template<class MAP_TYPE>
bool ifw::core::utils::base::ElInMap ( const std::string & key,
const MAP_TYPE & map )

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

◆ ElInVector()

template<class TYPE>
int32_t ifw::core::utils::base::ElInVector ( const std::vector< TYPE > & vect,
const TYPE & value )

Check for specific element in the list. Return index if found, otherwise -1.

◆ GenUniqueId()

std::string ifw::core::utils::base::GenUniqueId ( const std::string & prefix = "")

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

◆ InstallFndLog4cplusBridge()

void ifw::core::utils::base::InstallFndLog4cplusBridge ( const std::string & logger_name)

Install the FND->log4cplus bridge as the process-wide ifw-fnd logger. Bridged FND* output goes to the log4cplus logger named logger_name (configure it in log.properties). Idempotent: does nothing if an ifw-fnd logger is already installed. Call once at startup, before anything logs via FND*.

◆ Logger()

log4cplus::Logger & ifw::core::utils::base::Logger ( )

◆ ResolvePath()

std::string ifw::core::utils::base::ResolvePath ( const std::string & filename)

Resolve the filename if it contains env. variables, "~" and relative paths.

Variable Documentation

◆ CFGPATH

const std::string ifw::core::utils::base::CFGPATH = "CFGPATH"

◆ DATAROOT

const std::string ifw::core::utils::base::DATAROOT = "DATAROOT"

◆ EXT_FITS

const std::string ifw::core::utils::base::EXT_FITS = "fits"

◆ FAILURE

const int64_t ifw::core::utils::base::FAILURE = 1

◆ INTROOT

const std::string ifw::core::utils::base::INTROOT = "INTROOT"

◆ INVALID

const std::string ifw::core::utils::base::INVALID = "__INVALID__"

◆ NO_TIMEOUT

const int64_t ifw::core::utils::base::NO_TIMEOUT = -1

◆ NOT_IMPLEMENTED

const std::string ifw::core::utils::base::NOT_IMPLEMENTED = "NotImplemented"

◆ SUCCESS

const int64_t ifw::core::utils::base::SUCCESS = 0

◆ SYSROOT

const std::string ifw::core::utils::base::SYSROOT = "SYSROOT"

◆ UNDEFINED

const std::string ifw::core::utils::base::UNDEFINED = "__UNDEFINED__"