The Flow generator is a tool accessible from the Control Center under the Tools menu. It is provided to ease the development of customs flows by creating a basic C++ skeleton of the flow. Flows within NDFS-II are implemented as shared library, meaning the core of the system does not need to be recompiled in order to include the new flow. They can be seen as plug-ins. You can use the flows provided by the system, but in many cases it is convenient to develop your own kind of flows dedicated to handle specific data types. The Control Center provides a tool to ease the creation of customs flows: the Flow Generator.
This tool will help you to create the C++ skeleton of your flow by generating the required source files needed to implement a flow. By using it, you can describe a flow, define its name, the maximum buffer size and the history size that represents the size of the internal flow queue. These 3 parameters are required in each flow. This tool also allows defining the prototype of methods specific to your flow.
Once the flow is fully described, you can save the description of the flow from the File menu, and generate the C++ code of the flow. The files generated are saved in the folder where you save the description file of the flow. Regardless of where you generate the file, we strongly encourage you to store the header file of your flow in the src/flows/Flow_YourFlow and the library once built in the lib/flows folder. It will make the development of the your client nodes easier.
For the example above, the generated files are:
Flow_Example.h: This is the header file of the flow and is not supposed to be edited. If you decide to edit it, be very careful when using the Flow Generator with this flow because it will regenerate the file and therefore all your modifications will be lost.
Flow_Example.cpp: This is the implementation file of the flow. Same as above, if you generate your flow again, your modifications will be lost.
Flow_Example_functions.cpp: This file is an implementation file containing the customs methods you have defined in the box at the bottom of the windows. It contains at least to empty methods ready to be implemented, user_init() and user_close(). These methods are respectively invoked at the creation of the flow and at the destruction. These methods are provided for convenience. If you generate the code of your flow again and this file already exists, it won’t be overwritten.
Flow_Example.pro: This file is a standard Qt project file provided to help building the shared library of the flow.
Creating a flow has several advantages: if they have been named properly it increase the visibility when monitoring applications with many flows. It is also a convenient way to perform some automatic operations on the data blocks before sending them or receiving them. One can find useful to handle endianness issues in a flow, so the client node that produces or consumes data does not have to handle it in its code. It could also be used to add metadata or interpret metadata, etc.
Let’s say someone needs to transport matrices of data between client nodes. Some consuming client nodes would be interested in these matrices represented as a NxM table as it has been sent while other would prefer it to be represented as a vector of size NxM. The process of transforming the representation could be done in the client node code, it is however convenient to delegate this job to the flow itself and programming this methods only once instead of in every client node.
Basically any basic systematic processing of the data should be handle at this level. So in a client node, the only thing to do before working on the data could is to get them.
Created on 2008-06-18 by Antoine Fillinger - Last updated on 2008-11-23 by Antoine Fillinger