diff --git a/doc/rst/configuration/runtime_configuration.rst b/doc/rst/configuration/runtime_configuration.rst index 3123df503c..5a05eed558 100644 --- a/doc/rst/configuration/runtime_configuration.rst +++ b/doc/rst/configuration/runtime_configuration.rst @@ -12,27 +12,27 @@ The corresponding structure reflects the configuration file (:ref:`configuration Custom types ============ -In order to exclude configuration errors, custom datatypes for IP addresses and sizes are introduced. +In order to exclude configuration errors, custom datatypes for IP addresses and sizes (constrained integer) are introduced. For assigning an ip address simply assign a string with the desired address. Decimal and hexadecimal format is supported. In case the ip address is not valid, the type will throw a std::invalid_argument exception. -You can use the ip address like a normal string object. For example: +The ip address can be used like a normal string object. For example: .. code-block:: c++ eCAL::Config::IpAddressV4 ip_address = std::string("192.168.7.1"); // in hex: "C0.A8.7.1" std::cout << ip_address << "\n"; -Sizes are specified with a minimum (default: 0), step (default: 1) and maximum (default: maximum of int) value. +ConstrainedInteger are specified with a minimum (default: 0), step (default: 1) and maximum (default: maximum of int) value. In case the assigned value does not fit into the specified limitation, the type will throw a std::invalid_argument exception. -You can use the size object like a normal integer. +The size object can be used like a normal integer. .. code-block:: c++ - eCAL::Config::LimitSize<1024, 512, 8192> size_4mb = 1024 + 6 * 512; + eCAL::Config::ConstrainedInteger<1024, 512, 8192> size_4mb = 1024 + 6 * 512; std::cout << size_4mb << "\n"; For specifying sizes in the ecal configuration object, refer to the .ini file or "ecal/types/ecal_config_types.h" for the limitations. @@ -40,9 +40,13 @@ For specifying sizes in the ecal configuration object, refer to the .ini file or Initialization of the configuration =================================== -The configuration will be first initialized with the default .ini file found in the system. -In case the .ini to use is specified vial command line parameter, this one is chosen instead. -If it cannot find any .ini file, default values will be used for the first initialization of the configuration. +The configuration will be first initialized with the default values specified by eCAL. +If you want to use the systems eCAL .ini file, call the InitConfigWithDefaultIni() function of the config object. + +In case the .ini to use is specified via command line parameter, this one is chosen instead. +The object will throw an error, in case the specified .ini file cannot be found. + +It is also possible to specify the .ini by calling the function InitConfig(std::string _ini_path) of the config object. * |fa-file-alt| :file:`hello_config/main.cpp`: diff --git a/doc/rst/configuration/src/hello_config/main.cpp b/doc/rst/configuration/src/hello_config/main.cpp index 5cf693d5f9..e487131843 100644 --- a/doc/rst/configuration/src/hello_config/main.cpp +++ b/doc/rst/configuration/src/hello_config/main.cpp @@ -8,6 +8,12 @@ int main(int argc, char** argv) // Create a configuration object with the command line arguments eCAL::Config::eCALConfig custom_config(argc, argv); + // Use the .ini file of the system ... + custom_config.InitConfigWithDefaultIni(); + + // .. or specify an own .ini file to use + custom_conig.InitConfig("C:\\eCAL_local.ini"); + // Set the values in a try/catch block, as wrong configuration leads to exceptions try {