Skip to content

QuantumGate Extender Modules

Karel Donk edited this page Sep 27, 2018 · 5 revisions

QuantumGate Extender Modules are special dynamic link libraries (DLLs) containing one or more extender class definitions which are derived from the QuantumGate::Extender class. Through such a module, extenders can easily be compiled, packaged and distributed together.

Apart from the extender class definitions, a QuantumGate Extender Module should also contain a special function that will get called by a QuantumGate::Local instance when the module gets loaded. The signature of that function is as follows:

QuantumGate::Result<Vector<std::shared_ptr<QuantumGate::Extender>>>
    MakeQuantumGateExtenders();

The function should return a QuantumGate::Vector collection of std::shared_ptrs to instances of QuantumGate::Extender objects. Once the function gets called, you are responsible for instantiating these extender objects, adding them to the collection and returning that collection. Upon failure a std::error_code can be returned indicating failure.

The MakeQuantumGateExtenders function should be exported from the module file, for example, by using a .def file when linking. If this function isn't exported, the QuantumGate instance will fail to load the extenders from the module.

Once the collection of QuantumGate::Extenders has been returned to the QuantumGate instance, it will proceed to add them and will immediately start them if the instance is running. Use the QuantumGate::Local::AddExtenderModule and QuantumGate::Local::RemoveExtenderModule member functions to add and remove modules from a QuantumGate instance.

Examples

The "Examples" subfolder in the QuantumGate project folder contains a minimal example of a QuantumGate Extender Module.

Clone this wiki locally