Skip to main content Link Search Menu Expand Document (external link)

Factories

In order to add functionality through a plugin the plugin must register to one of the factories.

Currently the following factories are available:

Classes registering to factories need to be configurable, so you’ll have to write a config.toml. Here’s a minimal example:

[build.IPoAC]
  type = "plugin"
  version = "v0.0.1"
  git = false

[config.IPoAC]
  comment = "IP over Avian Carrier"
  parent = "transport"

  [[config.IPoAC.settings]]
    name = "enabled"
    type = "bool"
    default = false
    comment = "Enable IPoAC transport."
#include <transport/server.h>
#include <generated/config/ipoac.h>

namespace transport {
class IPoAC : public server::registrar<IPoAC, config::IPoAC> {
public:
  explicit IPoAC(config_t const& c) : registrar(c) {}
};
}

Don’t forget to turn on code generation for the plugin subproject!