SimGrid  3.18
Versatile Simulation of Distributed Systems
config.hpp File Reference
#include <xbt/base.h>
#include <cstdlib>
#include <functional>
#include <initializer_list>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
#include <xbt/config.h>

Classes

class  simgrid::config::missing_key_error
 
class  simgrid::config::Flag< T >
 A variable bound to a CLI option. More...
 

Namespaces

 simgrid
 Alltoall Bruck.
 
 simgrid::config
 

Functions

template<class T >
std::string simgrid::config::to_string (T &&value)
 
std::string const & simgrid::config::to_string (std::string &value)
 
std::string const & simgrid::config::to_string (std::string const &value)
 
std::string simgrid::config::to_string (std::string &&value)
 
template<class T >
T const & simgrid::config::getConfig (const char *name)
 
template int const & simgrid::config::getConfig< int > (const char *name)
 
template double const & simgrid::config::getConfig< double > (const char *name)
 
template bool const & simgrid::config::getConfig< bool > (const char *name)
 
template std::string const & simgrid::config::getConfig< std::string > (const char *name)
 
template<class T >
void simgrid::config::declareFlag (const char *name, const char *description, T value, std::function< void(const T &)> callback=std::function< void(const T &)>())
 Register a configuration flag. More...
 
template void simgrid::config::declareFlag (const char *name, const char *description, int value, std::function< void(int const &)> callback)
 
template void simgrid::config::declareFlag (const char *name, const char *description, double value, std::function< void(double const &)> callback)
 
template void simgrid::config::declareFlag (const char *name, const char *description, bool value, std::function< void(bool const &)> callback)
 
template void simgrid::config::declareFlag (const char *name, const char *description, std::string value, std::function< void(std::string const &)> callback)
 
void simgrid::config::alias (const char *realname, const char *aliasname)
 
void simgrid::config::alias (std::initializer_list< const char *> names)
 
template<class T >
void simgrid::config::bindFlag (T &value, const char *name, const char *description)
 Bind a variable to configuration flag. More...
 
template<class T >
void simgrid::config::bindFlag (T &value, std::initializer_list< const char *> names, const char *description)
 
template<class T , class F >
std::enable_if< std::is_same< void, decltype(std::declval< F >)(std::declval< const T & >)))>::value, void >::type simgrid::config::bindFlag (T &value, std::initializer_list< const char *> names, const char *description, F callback)
 Bind a variable to configuration flag. More...
 
template<class T , class F >
std::enable_if< std::is_same< void, decltype(std::declval< F >)(std::declval< const T & >)))>::value, void >::type simgrid::config::bindFlag (T &value, const char *name, const char *description, F callback)
 
template<class T , class F >
std::enable_if< std::is_same< bool, decltype(std::declval< F >)(std::declval< const T & >)))>::value, void >::type simgrid::config::bindFlag (T &value, const char *name, const char *description, F callback)
 Bind a variable to configuration flag. More...
 
std::string xbt_cfg_get_string (const char *name)
 Retrieve a string value of a variable (get a warning if not uniq) More...
 

Function Documentation

◆ xbt_cfg_get_string()

std::string xbt_cfg_get_string ( const char *  key)

Retrieve a string value of a variable (get a warning if not uniq)

Parameters
keythe name of the variable

Returns the first value from the config set under the given name. If there is more than one value, it will issue a warning. Returns nullptr if there is no value.

Warning
the returned value is the actual content of the config set