Runtime configuration

eCAL provides an interface to access and modify its options before initialization. The corresponding structure reflects the configuration file (ecal.yaml).

Custom types

In order to rule out configuration errors, a custom datatype for IP addresses (IpAddressV4) is introduced.

IpAddressV4: 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.

The IP address can be used like a normal string object. For example:

eCAL::Types::IpAddressV4 ip_address = "192.168.7.1"; // in hex: "C0.A8.7.1"
std::cout << ip_address << "\n";

Global configuration initialization

To get the configuration, create the object by using the function in the init namespace:

auto custom_config = eCAL::Init::Configuration();

The configuration will be first initialized with the values specified by your ecal.yaml.

It is also possible to specify the .yaml by calling the function

custom_config.InitFromFile("path/to/your/ecal.yaml");

Individual publisher/subscriber configuration

Like a global configuration to pass at initialization, it is also possible to create indiviual configurations for publisher and subscriber. That means it is possible to, e.g., create two publisher which send on different transport layers: