7.4. Runtime Configuration

In eCAL it is also possible to configure the environment at runtime. The eCAL API provides a set of structures that reflect the yaml configuration file (ecal.yaml).

You can pass this configuration structure to eCAL::Initialize().

But there is more: You can also modifiy the configuration of each publisher and subscriber individually. This allows you to be more flexible in the design of your application.

Important

Once set and passed to eCAL::Initialize(), the configuration is set. The getters for the configuration structures, e.g. eCAL::GetConfiguration(), return a constant struct. So it is has no effect to modify the configuration object without passing it to eCAL::Initialize().

In our example we will create multiple publishers and subscribers. They will communicate on different layers and will not interfere with each other, besides the same topic name.

7.4.1. Cake Publisher

|fa-folder-open|
├─ |fa-folder-open| C++
│  └─ |fa-file-alt| cake_send.cpp
│
└─ |fa-folder-open| C
   └─ |fa-file-alt| cake_send_c.c

7.4.2. Cake Receiver

|fa-folder-open|
├─ |fa-folder-open| C++
│  └─ |fa-file-alt| cake_receive.cpp
│
└─ |fa-folder-open| C
   └─ |fa-file-alt| cake_receive_c.c