The dynamic-graph package is used to connect computation nodes, "entities" together using a graph system, akin to what Simulink does. With the building blocks this package provides, you can easily create a full computation graph for a given problem. It is the basis for the stack of tasks operation.
This code implements the factory design pattern, making creation of entities available to packages depending on the dynamic-graph API.
Objects, which are derived from Entities (base class dynamicgraph::Entity), can be declared within the code and compiled to shared libraries (.so/.dll files). These libraries can be loaded at run-time using the PluginLoader methods, and at the same time register their class names to the Factory (see the examples in the SOT documentation to learn how).
The Factory can then create instances of these objects and subsequently register them in the Pool, where they can be listed, accessed, and acted upon (see sotPoolStorage documentation). Basic commands defined by entities include signal connection graph file generation, help and name print, and signals.
Finally, a shell (command-line) interface is made available thanks to the Interpreter class (see the file test_shell.cpp for an example). Objects deriving from Entity can expose their own commands by overriding the Entity's default commandLine() method. It is possible to load a plugin to register custom shell commands; see shell-functions and shell-procedure for an example.
Some basic shell functions, and support for procedures, are also included. For a complete list of those, load the plugin shell-functions.so and type 'help' at the command line.
The public static objects (singletons) made available by including the corresponding headers in this module are:
Since most of the functionality in projects using the dynamic-graph framework is exposed from entities, here is a short description of all the entities contained in this package. Note that most entities are contained in a binary file that closely matches the entities' names in the scripts; loading this file with the plugin loader will enable creation of this entity through the factory.
The entities will be placed in ${PREFIX}/lib/plugin (since this may change, it is advised to check the install log or the CMakeLists.txt file to check the installation path).
Entities can output different types of signals. All signals are templated by a Time tick type parameter (which is used in the caching of signals) - usually int
. Signals are also templated after the type of data they accept or provide. For example: (example) For a more detailed programmer-oriented description of signals, please see Signals
(...)