OnixS C++ ICE Binary Order Entry Handler 1.1.1
API Documentation
Loading...
Searching...
No Matches
Settings Class Reference

Public Member Functions

 Settings ()=default
 Settings (const std::string &filename)
template<typename T = std::string>
get (const std::string &key, typename std::enable_if< std::is_integral< T >::value, void * >::type=nullptr) const
template<typename T = std::string>
get (const std::string &key, T defaultValue, typename std::enable_if< std::is_integral< T >::value, void * >::type=nullptr) const
template<typename T = std::string>
get (const std::string &key, typename std::enable_if< std::is_same< T, std::string >::value, void * >::type=nullptr) const
template<typename T = std::string>
get (const std::string &key, T defaultValue, typename std::enable_if< std::is_same< T, std::string >::value, void * >::type=nullptr) const
template<typename T = std::string>
get (const std::string &key, typename std::enable_if< std::is_same< T, bool >::value, void * >::type=nullptr) const
template<typename T = std::string>
get (const std::string &key, T defaultValue, typename std::enable_if< std::is_same< T, bool >::value, void * >::type=nullptr) const
bool isSet (const std::string &key) const

Detailed Description

Definition at line 28 of file Settings.h.

Constructor & Destructor Documentation

◆ Settings() [1/2]

Settings ( )
default

◆ Settings() [2/2]

Settings ( const std::string & filename)
inline

Definition at line 33 of file Settings.h.

34 : map_(System::ConfigurationParser::parseConfigFile(filename, "TradingClient"))
35 {
36 }

Member Function Documentation

◆ get() [1/6]

template<typename T = std::string>
T get ( const std::string & key,
T defaultValue,
typename std::enable_if< std::is_integral< T >::value, void * >::type = nullptr ) const
inline

Definition at line 45 of file Settings.h.

46 {
47 const auto v = getIfAny(key);
48 return v.empty() ? defaultValue : System::ConfigurationParser::Utils::fromString<T>(v);
49 }

◆ get() [2/6]

template<typename T = std::string>
T get ( const std::string & key,
T defaultValue,
typename std::enable_if< std::is_same< T, bool >::value, void * >::type = nullptr ) const
inline

Definition at line 70 of file Settings.h.

71 {
72 const auto v = getIfAny(key);
73 return v.empty() ? defaultValue : System::ConfigurationParser::Utils::fromString<bool>(getAsStr(v));
74 }

◆ get() [3/6]

template<typename T = std::string>
T get ( const std::string & key,
T defaultValue,
typename std::enable_if< std::is_same< T, std::string >::value, void * >::type = nullptr ) const
inline

Definition at line 58 of file Settings.h.

59 {
60 return getAsStr(key, defaultValue);
61 }

◆ get() [4/6]

template<typename T = std::string>
T get ( const std::string & key,
typename std::enable_if< std::is_integral< T >::value, void * >::type = nullptr ) const
inline

Definition at line 39 of file Settings.h.

40 {
41 return System::ConfigurationParser::Utils::fromString<T>((getAsStr(key)));
42 }

◆ get() [5/6]

template<typename T = std::string>
T get ( const std::string & key,
typename std::enable_if< std::is_same< T, bool >::value, void * >::type = nullptr ) const
inline

Definition at line 64 of file Settings.h.

65 {
66 return System::ConfigurationParser::Utils::fromString<bool>(getAsStr(key));
67 }

◆ get() [6/6]

template<typename T = std::string>
T get ( const std::string & key,
typename std::enable_if< std::is_same< T, std::string >::value, void * >::type = nullptr ) const
inline

Definition at line 52 of file Settings.h.

53 {
54 return getAsStr(key);
55 }

◆ isSet()

bool isSet ( const std::string & key) const
inline

Definition at line 76 of file Settings.h.

77 {
78 return map_.find(key) != map_.end();
79 }