DP3
Public Member Functions | List of all members
dp3::common::ParameterValue Class Reference

The value of a parameter. More...

#include <ParameterValue.h>

Public Member Functions

 ParameterValue ()
 Default constructor uses empty string. More...
 
 ParameterValue (const std::string &value, bool trim=true)
 
ParameterValue expand () const
 Expand the string using StringUtil::expandedArrayString. More...
 
const std::string & get () const
 Get the value string. More...
 
ParameterRecord getRecord () const
 Get the parameter value as a ParameterRecord. More...
 
std::vector< ParameterValuegetVector () const
 Get the parameter value as a vector of ParameterValues. More...
 
bool isRecord () const
 Is the value a record? More...
 
bool isVector () const
 Is the value a vector? More...
 
bool getBool () const
 
int getInt () const
 
unsigned int getUint () const
 
int16_t getInt16 () const
 
uint16_t getUint16 () const
 
int32_t getInt32 () const
 
int32_t getUint32 () const
 
int64_t getInt64 () const
 
uint64_t getUint64 () const
 
float getFloat () const
 
double getDouble () const
 
std::string getString () const
 
time_t getTime () const
 
std::vector< bool > getBoolVector () const
 
std::vector< int > getIntVector () const
 
std::vector< unsigned int > getUintVector () const
 
std::vector< int16_t > getInt16Vector () const
 
std::vector< uint16_t > getUint16Vector () const
 
std::vector< int32_t > getInt32Vector () const
 
std::vector< uint32_t > getUint32Vector () const
 
std::vector< int64_t > getInt64Vector () const
 
std::vector< uint64_t > getUint64Vector () const
 
std::vector< float > getFloatVector () const
 
std::vector< double > getDoubleVector () const
 
std::vector< std::string > getStringVector () const
 
std::vector< time_t > getTimeVector () const
 
 operator bool () const
 
 operator int () const
 
 operator unsigned int () const
 
 operator float () const
 
 operator double () const
 
 operator std::string () const
 
 operator time_t () const
 
 operator std::vector< bool > () const
 
 operator std::vector< int > () const
 
 operator std::vector< unsigned int > () const
 
 operator std::vector< float > () const
 
 operator std::vector< double > () const
 
 operator std::vector< std::string > () const
 
 operator std::vector< time_t > () const
 
static time_t StringToTime_t (const std::string &aString)
 Convert a string to a time. More...
 
std::ostream & operator<< (std::ostream &os, const ParameterValue &pval)
 
std::istream & operator>> (std::istream &os, ParameterValue &pval)
 

Detailed Description

The value of a parameter.

ParameterValue represent a value of a parameter. It can contain a single value, but also a vector of ParameterValues or a ParameterRecord.

It contains various functions to obtain the value in the format desired.

Constructor & Destructor Documentation

◆ ParameterValue() [1/2]

dp3::common::ParameterValue::ParameterValue ( )
inline

Default constructor uses empty string.

◆ ParameterValue() [2/2]

dp3::common::ParameterValue::ParameterValue ( const std::string &  value,
bool  trim = true 
)
explicit

Create from the given string. Optionally left and right whitespace will be removed.

Member Function Documentation

◆ expand()

ParameterValue dp3::common::ParameterValue::expand ( ) const

Expand the string using StringUtil::expandedArrayString.

◆ get()

const std::string& dp3::common::ParameterValue::get ( ) const
inline

Get the value string.

◆ getBool()

bool dp3::common::ParameterValue::getBool ( ) const
inline

Get the parameter value in the given type.

◆ getBoolVector()

std::vector<bool> dp3::common::ParameterValue::getBoolVector ( ) const

◆ getDouble()

double dp3::common::ParameterValue::getDouble ( ) const
inline

◆ getDoubleVector()

std::vector<double> dp3::common::ParameterValue::getDoubleVector ( ) const

◆ getFloat()

float dp3::common::ParameterValue::getFloat ( ) const
inline

◆ getFloatVector()

std::vector<float> dp3::common::ParameterValue::getFloatVector ( ) const

◆ getInt()

int dp3::common::ParameterValue::getInt ( ) const
inline

◆ getInt16()

int16_t dp3::common::ParameterValue::getInt16 ( ) const
inline

◆ getInt16Vector()

std::vector<int16_t> dp3::common::ParameterValue::getInt16Vector ( ) const

◆ getInt32()

int32_t dp3::common::ParameterValue::getInt32 ( ) const
inline

◆ getInt32Vector()

std::vector<int32_t> dp3::common::ParameterValue::getInt32Vector ( ) const

◆ getInt64()

int64_t dp3::common::ParameterValue::getInt64 ( ) const
inline

◆ getInt64Vector()

std::vector<int64_t> dp3::common::ParameterValue::getInt64Vector ( ) const

◆ getIntVector()

std::vector<int> dp3::common::ParameterValue::getIntVector ( ) const

◆ getRecord()

ParameterRecord dp3::common::ParameterValue::getRecord ( ) const

Get the parameter value as a ParameterRecord.

◆ getString()

std::string dp3::common::ParameterValue::getString ( ) const

◆ getStringVector()

std::vector<std::string> dp3::common::ParameterValue::getStringVector ( ) const

◆ getTime()

time_t dp3::common::ParameterValue::getTime ( ) const
inline

◆ getTimeVector()

std::vector<time_t> dp3::common::ParameterValue::getTimeVector ( ) const

◆ getUint()

unsigned int dp3::common::ParameterValue::getUint ( ) const
inline

◆ getUint16()

uint16_t dp3::common::ParameterValue::getUint16 ( ) const
inline

◆ getUint16Vector()

std::vector<uint16_t> dp3::common::ParameterValue::getUint16Vector ( ) const

◆ getUint32()

int32_t dp3::common::ParameterValue::getUint32 ( ) const
inline

◆ getUint32Vector()

std::vector<uint32_t> dp3::common::ParameterValue::getUint32Vector ( ) const

◆ getUint64()

uint64_t dp3::common::ParameterValue::getUint64 ( ) const
inline

◆ getUint64Vector()

std::vector<uint64_t> dp3::common::ParameterValue::getUint64Vector ( ) const

◆ getUintVector()

std::vector<unsigned int> dp3::common::ParameterValue::getUintVector ( ) const

◆ getVector()

std::vector<ParameterValue> dp3::common::ParameterValue::getVector ( ) const

Get the parameter value as a vector of ParameterValues.

◆ isRecord()

bool dp3::common::ParameterValue::isRecord ( ) const
inline

Is the value a record?

◆ isVector()

bool dp3::common::ParameterValue::isVector ( ) const
inline

Is the value a vector?

◆ operator bool()

dp3::common::ParameterValue::operator bool ( ) const
inline

Convert the parameter value to the given type using conversion operators.

◆ operator double()

dp3::common::ParameterValue::operator double ( ) const
inline

◆ operator float()

dp3::common::ParameterValue::operator float ( ) const
inline

◆ operator int()

dp3::common::ParameterValue::operator int ( ) const
inline

◆ operator std::string()

dp3::common::ParameterValue::operator std::string ( ) const
inline

◆ operator std::vector< bool >()

dp3::common::ParameterValue::operator std::vector< bool > ( ) const
inline

◆ operator std::vector< double >()

dp3::common::ParameterValue::operator std::vector< double > ( ) const
inline

◆ operator std::vector< float >()

dp3::common::ParameterValue::operator std::vector< float > ( ) const
inline

◆ operator std::vector< int >()

dp3::common::ParameterValue::operator std::vector< int > ( ) const
inline

◆ operator std::vector< std::string >()

dp3::common::ParameterValue::operator std::vector< std::string > ( ) const
inline

◆ operator std::vector< time_t >()

dp3::common::ParameterValue::operator std::vector< time_t > ( ) const
inline

◆ operator std::vector< unsigned int >()

dp3::common::ParameterValue::operator std::vector< unsigned int > ( ) const
inline

◆ operator time_t()

dp3::common::ParameterValue::operator time_t ( ) const
inline

◆ operator unsigned int()

dp3::common::ParameterValue::operator unsigned int ( ) const
inline

◆ StringToTime_t()

static time_t dp3::common::ParameterValue::StringToTime_t ( const std::string &  aString)
static

Convert a string to a time.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ParameterValue pval 
)
friend

Put or get to/from ostream.

◆ operator>>

std::istream& operator>> ( std::istream &  os,
ParameterValue pval 
)
friend

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