DUECA/DUSIME
|
Base class for key-based access to helper classes for DCO objects. More...
#include <DCOMetaFunctor.hxx>
Public Member Functions | |
DCOMetaFunctor () | |
Constructor. | |
virtual | ~DCOMetaFunctor () |
Destructor. | |
Base class for key-based access to helper classes for DCO objects.
These classes can be accessed through the DataClassRegistry. For typical use, decide on the following:
Create a class that derives from this DCOMetaFunctor. Give that class a set of virtual methods, or typically only define the operator(), that are const (i.e. the class may never be changed).
In the DCO opjects that you want to extend, add extra code (with the IncludeFile option). Another possibility is extending the code generator with a plugin to add this code. The extra code defines a class derived from the class defined in the previous step. This class can then access a specific dco object's meta information (since you don't have an actual object to work with).
If you want to work with data in a channel, and have access (or want to have, since you are making a generic module) to only the data class name, you can add a functor derived (directly or indirectly) from DCOFunctor. This functor can then be created through your DCOMetaFunctor, and once you have it, you can use it with a channel read token, or a channel write token.
Note that you can hand-write a metafunctor for a specific datatype, but that the most efficient (if you need this a lot), is extending the code generator with a plugin. This has been done for HDF5 functors.
Since this is all very theoretical, let's assume we want to write DCO objects to some SQL-type database. The derived metafunctor gets a call with a pointer to the database and the name for the table. It creates a derivative of DCOFunctor that can write its data in the table.