#include <SmacqModule-interface.h>
Classes | |
struct | algebra |
The algebra element is optional and is used only by the dataflow optimizer. More... | |
struct | smacq_init |
This context structure is passed to SmacqModule constructors. More... | |
class | UsesArray |
Public Member Functions | |
typedef SmacqModule * | constructor_fn (struct smacq_init *) |
SMACQ modules are object files that can be statically or dynamically loaded into a program. | |
SmacqModule (struct smacq_init *context) | |
Most subclasses will define their own constructor which will initialize the instance based on the given context. | |
virtual | ~SmacqModule () |
A subclass can have its own destructor. | |
virtual smacq_result | consume (DtsObject datum, int &outchan) |
The consume() method is called when there is new data for a module to process. | |
virtual smacq_result | produce (DtsObject &datump, int &outchan) |
The produce() method is called when SMACQ expects an object to produce new data. | |
virtual bool | usesOtherFields (DtsField f) |
This method is called by the join optimizer. | |
Protected Member Functions | |
void | comp_uses (dts_comparison *c) |
dts_comparison * | parse_tests (std::string) |
Return a newly constructed dts_comparison datastructure from the given arguments. | |
virtual DtsField | usesfield (const char *name) |
This method wraps DTS::usesfield() but keeps track of what this module uses. | |
void | enqueue (DtsObject &, int outchan=0) |
Enqueue an object for output to the specified output channel. | |
Protected Attributes | |
UsesArray | usesFields |
DTS * | dts |
Each module instance runs in the context of a DTS instance. | |
SmacqScheduler * | scheduler |
Each module instance is run by a scheduler. | |
SmacqGraphNode * | self |
A pointer to ourself in the current dataflow graph. |
This document describes the programming interface used by authors of dataflow modules. These modules are dynamically loaded and may be instantiated multiple times. Global and static variables are therefore deprecated for most cases.
SmacqModule::SmacqModule | ( | struct smacq_init * | context | ) | [inline] |
Most subclasses will define their own constructor which will initialize the instance based on the given context.
typedef SmacqModule* SmacqModule::constructor_fn | ( | struct smacq_init * | ) |
SMACQ modules are object files that can be statically or dynamically loaded into a program.
Each module should use the SMACQ_MODULE() macro to make sure that the module defines a constructor function that instantiates the class.
smacq_result SmacqModule::consume | ( | DtsObject | datum, | |
int & | outchan | |||
) | [inline, virtual] |
The consume() method is called when there is new data for a module to process.
It is passed a pointer to a data object and a reference to an output channel descriptor. The return code should be SMACQ_PASS if the object is not filtered out and SMACQ_FREE if it is. In addition, the return code can be OR'd with the following flags: SMACQ_ERROR specifies that there was a fatel error in the module. SMACQ_END signifies that the module wishes to never be called again.
Reimplemented in ThreadedSmacqModule, and ThreadedSmacqModule.
smacq_result SmacqModule::produce | ( | DtsObject & | datump, | |
int & | outchan | |||
) | [inline, virtual] |
The produce() method is called when SMACQ expects an object to produce new data.
DtsField SmacqModule::usesfield | ( | const char * | name | ) | [inline, protected, virtual] |
This method wraps DTS::usesfield() but keeps track of what this module uses.