event-driven
|
You are ready to write your own code that uses the tools in the event-driven
library to process events. An example module is provided in example_module that you can use as the basis for writing a module that can be integrated into the YARP
framework.
The module has the following functionality:
*.ini
file to load configuration options, and setting options via command line arguments.ctrl+c
commands and allowing functions to close ports and clean memory.event-driven
ports for reading and writing events.event-driven
, as well as installation of the configuration and application files in locations required by YARP
.First, copy the example files to the new location of your project, e.g. the same folder where you have cloned event-driven
. Assuming a<path_to_projects>
directory:
The project can be compiled with modifications:
However, some modifications should be made to personalise the project. The first step would be to change the folder, file and project name:
On line 5 change the project name to <my-module-name>
, then save (ctrl+o
) and exit (ctrl+x
).
On line 7, 19,24, and 124 change the class, constructor and declaration to <my-module-name>
, then save (ctrl+o
) and exit (ctrl+x
).
Change the first line of the default configuration file and the lines that refer to example-module
in the example yarpmanager
application. For example:
or if you like:
The module should now be personalised to your processing task.
If you like, you can import the project into your favourite IDE. To do so, e.g. for QtCreator open a new project by selecting <path_to_projects>/<my-module-name>/CmakeLists.txt
. Select the kits release
and debug
modifying the build directory to <path_to_projects>/<my-module-name>/build
and <path_to_projects>/<my-module-name>/build-debug
respectively. You should now be able to edit, compile, run and debug the module from within QtCreator.