FairMQ
1.4.33
C++ Message Queuing Library and Framework
|
Public Member Functions | |
void | ParseAll (const std::vector< std::string > &cmdArgs, bool allowUnregistered) |
void | ParseAll (const int argc, char const *const *argv, bool allowUnregistered=true) |
void | Notify () |
void | AddToCmdLineOptions (const boost::program_options::options_description optDesc, bool visible=true) |
boost::program_options::options_description & | GetCmdLineOptions () |
int | Count (const std::string &key) const |
Checks a property with the given key exist in the configuration. More... | |
std::unordered_map< std::string, int > | GetChannelInfo () const |
Retrieve current channel information. More... | |
std::vector< std::string > | GetPropertyKeys () const |
Discover the list of property keys. More... | |
template<typename T > | |
T | GetProperty (const std::string &key) const |
Read config property, throw if no property with this key exists. More... | |
template<typename T > | |
T | GetProperty (const std::string &key, const T &ifNotFound) const |
Read config property, return provided value if no property with this key exists. More... | |
std::string | GetPropertyAsString (const std::string &key) const |
Read config property as string, throw if no property with this key exists. More... | |
std::string | GetPropertyAsString (const std::string &key, const std::string &ifNotFound) const |
Read config property, return provided value if no property with this key exists. More... | |
fair::mq::Properties | GetProperties (const std::string &q) const |
Read several config properties whose keys match the provided regular expression. More... | |
fair::mq::Properties | GetPropertiesStartingWith (const std::string &q) const |
Read several config properties whose keys start with the provided string. More... | |
std::map< std::string, std::string > | GetPropertiesAsString (const std::string &q) const |
Read several config properties as string whose keys match the provided regular expression. More... | |
std::map< std::string, std::string > | GetPropertiesAsStringStartingWith (const std::string &q) const |
Read several config properties as string whose keys start with the provided string. More... | |
template<typename T > | |
void | SetProperty (const std::string &key, T val) |
Set config property. More... | |
template<typename T > | |
bool | UpdateProperty (const std::string &key, T val) |
Updates an existing config property (or fails if it doesn't exist) More... | |
void | SetProperties (const fair::mq::Properties &input) |
Set multiple config properties. More... | |
bool | UpdateProperties (const fair::mq::Properties &input) |
Updates multiple existing config properties (or fails of any of then do not exist, leaving property store unchanged) More... | |
void | DeleteProperty (const std::string &key) |
Deletes a property with the given key from the config store. More... | |
void | AddChannel (const std::string &name, const FairMQChannel &channel) |
Takes the provided channel and creates properties based on it. More... | |
template<typename T > | |
void | Subscribe (const std::string &subscriber, std::function< void(typename fair::mq::PropertyChange::KeyType, T)> func) const |
Subscribe to property updates of type T. More... | |
template<typename T > | |
void | Unsubscribe (const std::string &subscriber) const |
Unsubscribe from property updates of type T. More... | |
void | SubscribeAsString (const std::string &subscriber, std::function< void(typename fair::mq::PropertyChange::KeyType, std::string)> func) const |
Subscribe to property updates, with values converted to string. More... | |
void | UnsubscribeAsString (const std::string &subscriber) const |
Unsubscribe from property updates that convert to string. More... | |
void | PrintHelp () const |
prints full options description | |
void | PrintOptions () const |
prints properties stored in the property container | |
void | PrintOptionsRaw () const |
prints full options description in a compact machine-readable format | |
const boost::program_options::variables_map & | GetVarMap () const |
returns the property container | |
template<typename T > | |
T | GetValue (const std::string &key) const |
Read config property, return default-constructed object if key doesn't exist. More... | |
template<typename T > | |
int | SetValue (const std::string &key, T val) |
std::string | GetStringValue (const std::string &key) const |
Read config property as string, return default-constructed object if key doesn't exist. More... | |
void fair::mq::ProgOptions::AddChannel | ( | const std::string & | name, |
const FairMQChannel & | channel | ||
) |
Takes the provided channel and creates properties based on it.
name | channel name |
channel | FairMQChannel reference |
int fair::mq::ProgOptions::Count | ( | const std::string & | key | ) | const |
Checks a property with the given key exist in the configuration.
key |
void fair::mq::ProgOptions::DeleteProperty | ( | const std::string & | key | ) |
Deletes a property with the given key from the config store.
key |
unordered_map< string, int > fair::mq::ProgOptions::GetChannelInfo | ( | ) | const |
Retrieve current channel information.
Properties fair::mq::ProgOptions::GetProperties | ( | const std::string & | q | ) | const |
Read several config properties whose keys match the provided regular expression.
q | regex string to match for |
map< string, string > fair::mq::ProgOptions::GetPropertiesAsString | ( | const std::string & | q | ) | const |
Read several config properties as string whose keys match the provided regular expression.
q | regex string to match for |
map< string, string > fair::mq::ProgOptions::GetPropertiesAsStringStartingWith | ( | const std::string & | q | ) | const |
Read several config properties as string whose keys start with the provided string.
q | string to match for |
Typically more performant than GetPropertiesAsString with regex
Properties fair::mq::ProgOptions::GetPropertiesStartingWith | ( | const std::string & | q | ) | const |
Read several config properties whose keys start with the provided string.
q | string to match for |
Typically more performant than GetProperties with regex
|
inline |
Read config property, throw if no property with this key exists.
key |
|
inline |
Read config property, return provided value if no property with this key exists.
key | |
ifNotFound | value to return if key is not found |
std::string fair::mq::ProgOptions::GetPropertyAsString | ( | const std::string & | key | ) | const |
Read config property as string, throw if no property with this key exists.
key |
Supports conversion to string for a fixed set of types, for custom/unsupported types add them via fair::mq::PropertyHelper::AddType<MyType>("optional label")
the provided type must then be convertible to string via operator<<
std::string fair::mq::ProgOptions::GetPropertyAsString | ( | const std::string & | key, |
const std::string & | ifNotFound | ||
) | const |
Read config property, return provided value if no property with this key exists.
key | |
ifNotFound | value to return if key is not found |
Supports conversion to string for a fixed set of types, for custom/unsupported types add them via fair::mq::PropertyHelper::AddType<MyType>("optional label")
the provided type must then be convertible to string via operator<<
vector< string > fair::mq::ProgOptions::GetPropertyKeys | ( | ) | const |
Discover the list of property keys.
string fair::mq::ProgOptions::GetStringValue | ( | const std::string & | key | ) | const |
Read config property as string, return default-constructed object if key doesn't exist.
key |
|
inline |
Read config property, return default-constructed object if key doesn't exist.
key |
void fair::mq::ProgOptions::SetProperties | ( | const fair::mq::Properties & | input | ) |
Set multiple config properties.
props | fair::mq::Properties as an alias for std::map<std::string, Property>, where property is boost::any |
|
inline |
Set config property.
key | |
val |
|
inline |
Subscribe to property updates of type T.
subscriber | |
callback | function |
Subscribe to property changes with a callback to monitor property changes in an event based fashion.
|
inline |
Subscribe to property updates, with values converted to string.
subscriber | |
callback | function |
Subscribe to property changes with a callback to monitor property changes in an event based fashion. Will convert the property to string.
|
inline |
Unsubscribe from property updates of type T.
subscriber |
|
inline |
Unsubscribe from property updates that convert to string.
subscriber |
bool fair::mq::ProgOptions::UpdateProperties | ( | const fair::mq::Properties & | input | ) |
Updates multiple existing config properties (or fails of any of then do not exist, leaving property store unchanged)
props | (fair::mq::Properties as an alias for std::map<std::string, Property>, where property is boost::any) |
|
inline |
Updates an existing config property (or fails if it doesn't exist)
key | |
val |