ChimeraTK-ApplicationCore  04.01.00
ConfigReader Module

This Module provides the following features:

  • read values from an xml config file to have them available at server initialization,
  • expose above values as process variables; these may connect to other ApplicationCore modules if needed.

Example usage

  • A server application using the config reader may look like:
    namespace ctk = ChimeratK
    struct Server : public ctk::Application {
    Server() : Application("testserver") {}
    ~Server() { shutdown(); }
    ctk::ConfigReader config{this, "config", "validConfig.xml", {"MyTAG"}};
    TestModule testModule{this, "TestModule", "The test module"};
    void Server::defineConnections() override;
    };
  • Values from validConfig.xml can be accessed at server startup:
    Server::Server() {
    auto config_var = config.get<int8_t>("module1/var8");
    auto config_arr = config.get<std::vector<int8>>("module1/submodule/intArray");
    // ...
    }

Configuration will be published as process variables, according to the hierarchy constructed in the configuration file.

XML file structure

  • A valid configuration file may look like:
      <configuration>
        <variable name="var8" type="int8" value="-123"/>
        <module name="module1">
          <variable name="var8" type="int8" value="-123"/>
          <module name="submodule">
              <variable name="intArray" type="int32">
              <value i="0" v="10"/>
              <value i="1" v="9"/>
              <value i="2" v="8"/>
              <value i="7" v="3"/>
              <value i="8" v="2"/>
              <value i="9" v="1"/>
              <value i="3" v="7"/>
              <value i="4" v="6"/>
              <value i="5" v="5"/>
              <value i="6" v="4"/>
           </variable>
          </module>
        </module>
      </configuration>
ChimeraTK::ConfigReader
Generic module to read an XML config file and provide the defined values as constant variables.
Definition: ConfigReader.h:113
ChimeraTK::Application::shutdown
void shutdown() override
This will remove the global pointer to the instance and allows creating another instance afterwards.
Definition: Application.cc:207
ChimeraTK::NodeType::Application
@ Application
ChimeraTK
InvalidityTracer application module.
Definition: spec_dataValidityPropagation.dox:2
ChimeraTK::Application
Definition: Application.h:48