62.2. Building event builder clients.

Event builder clients based on the framework consist of a skeleton application, user code and a Makefile that builds the executable program that you run. In the previous section we looked at what is in the user code. In this section we will look at the last bits of customization you need to do in the skeleton application as well as how to modify the Makefile so that it will build your event builder client program correctly.

The framework skeleton application should be copied from $DAQROOT/skeletons/evbclient. $DAQROOT is the top level installation directory of NSCLDAQ-10.2 or higher.

In the last section we saw how to write a CEVBClientApp class that provides data source specific code to get fragments from a data source and make them available to the event builder. The framework skeleton application provides a file Main.cpp that starts the framework code. One thing we need to do is to create an instance of our data source code. The data source code's base class constructor makes itself known to the framework.

This is shown in the highlighted parts of the code from Main.cpp below. The highlighted parts must be added by you:

Example 62-6. Configuring the event builder client framework


...
#include <EVBFramework.h>
#include "CEVBMyClient.h"           (1)
...
int
main(char** argv, int argc)
{
    CEVBMyClient myCode;           (2)
    CEVBClientFramework::main(argv, argc);  
}
            
(1)
You will need to include the header for your data source application. If your program provides several data sources, you need to include the header for each of them.
(2)
Creating an instance of your class is sufficent to register it with the framework (the base class constructor takes care of that).

Note that the call to CEVBClientFramework::main(argv, argc) passes in the command line parameters.

The Makefile is organized so that you can easily add your code by simply defining a few Makefile variables. These variables are:

USER_OBJECTS

The names of the object files generated by compiling your source files. If you have several object files they should be separated by whitespace.

USER_CXXFLAGS

If you have any C++ Compilation switches you want added add them here.

USER_CCFLAGS

If you you haave any C compilation switches you want added, add them here.

USER_LDFLAGS

If you have any loader flags you want added, add them here.