86
Each CNKProc contains a field counting the number of times that it has
been executed. This field is incremented by the pipeline engine,
which calls
incrementExecuteCount(). The current value, retrieved
by
getExecuteCount(), can be useful during debugging.
CNKProc::
virtual void checkBufs(int inputs, int outputs);
virtual void checkBufs(int minInputs, int maxInputs,
int minOutputs, int maxOutputs);
These methods are useful utility methods that can be called from the
init() method to check the number of inputs and outputs that have
been defined. If they wrong number is found, the error string of the
CNKProc is set to an error.
For the two-argument method, if the number of inputs and outputs is
not exactly the number specified, the error string is set.
For the four-argument method, the number of inputs and outputs
must be in the specified ranges. For example,
checkBufs(0,2,1,1)
checks that the number of inputs is 0, 1, or 2, and the number of
outputs is exactly 1.
CNKProc::
virtual long executeRequestRows();
virtual void executeReleaseRows(long rows);
These methods are useful utility methods that handle the most
common input and output manipulation from an
execute() method.
Using these methods, many simple
CNKProc execute() methods can
be defined in only a few lines.
The operation of these methods, and how they can be used in a
custom
execute() method, are described below.
Creating a
Subclass of
CNKProc
Creating a new subclass of CNKProc requires defining a new init()
and
execute() method, and possibly a new isReady() method, as
well as creating new methods specific to the new class. The pipeline
is informed of the class’s existence using a special macro.
CNK_DEFINE_ACCESSIBLE_CLASS Macro
The function for creating a new object of a class is created by using
the macro
CNK_DEFINE_ACCESSIBLE_CLASS (defined in
CNKPropertyInfo.h, which is included by CNKObj.h). Given the name
Commentaires sur ces manuels