Belle II Software development
LogVar Class Reference

Class to store variables with their name which were sent to the logging service. More...

#include <LogVariableStream.h>

Public Member Functions

template<class TVarType >
 LogVar (const std::string &name, const TVarType &v)
 Constructor which accepts any type as value and relies on boost lexical cast.
 
std::string getValue () const
 Returns the value stored for this variable.
 
std::string getName () const
 Returns the name stored for this variable.
 
bool operator== (const LogVar &lv) const
 Custom comparison operator.
 

Private Attributes

std::string m_name
 Stores the name of the variable.
 
std::string m_value
 String conversion of the value.
 

Detailed Description

Class to store variables with their name which were sent to the logging service.

Definition at line 24 of file LogVariableStream.h.

Constructor & Destructor Documentation

◆ LogVar()

LogVar ( const std::string &  name,
const TVarType &  v 
)
inline

Constructor which accepts any type as value and relies on boost lexical cast.

Parameters
nameString to identify the logged value
vValue to log, can be of any type which boost::lexical_cast is able to convert to a string.

Definition at line 33 of file LogVariableStream.h.

33 :
34 m_name(name),
35 m_value(boost::lexical_cast<std::string>(v))
36 {
37 }
std::string m_value
String conversion of the value.
std::string m_name
Stores the name of the variable.

Member Function Documentation

◆ getName()

std::string getName ( ) const
inline

Returns the name stored for this variable.

Definition at line 50 of file LogVariableStream.h.

51 {
52 return m_name;
53 }

◆ getValue()

std::string getValue ( ) const
inline

Returns the value stored for this variable.

Definition at line 42 of file LogVariableStream.h.

43 {
44 return m_value;
45 }

◆ operator==()

bool operator== ( const LogVar lv) const
inline

Custom comparison operator.

Definition at line 58 of file LogVariableStream.h.

59 {
60 return (lv.m_name == this->m_name) && (lv.m_value == this->m_value);
61 }

Member Data Documentation

◆ m_name

std::string m_name
private

Stores the name of the variable.

Best is a short string to describe which variable is presented, like "node number" etc.

Definition at line 66 of file LogVariableStream.h.

◆ m_value

std::string m_value
private

String conversion of the value.

Definition at line 70 of file LogVariableStream.h.


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