97
CNKProc* getProc(int i);
CNKProc* getProc(const char* name);
void addBuf(CNKBuf* buf);
void removeBuf(CNKBuf* buf);
int getNumBufs();
CNKBuf* getBuf(int i);
CNKBuf* getBuf(const char* name);
These are methods for adding and removing CNKProc and CNKBuf
objects from a pipeline. At any point, a pipeline contains an ordered
list of
CNKProc objects and an ordered list of CNKBuf objects. The
addProc, removeProc, addBuf, and removeBuf methods add or remove
a given
CNKProc or CNKBuf from the corresponding list. The
getNumProcs() and getNumBufs() methods return the sizes of the two
lists. The
getProc and getBuf methods allow retrieving a CNKProc or
CNKBuf by index in the list (0..N-1), or by the name of the CNKProc or
CNKBuf (according to CNKObj::getName()).
CNKPipeline::
void execute(long max_exec);
int getAnyProcReady();
The CNKPipeline::execute method executes the pipeline by
repeatedly calling the
execute() method of CNKProc objects in the
pipeline. Before calling the
CNKProc::execute method for a CNKProc,
the
CNKProc's isReady and isDone methods are called to check
whether it is ready to execute. If none of the
CNKProc objects are
ready to execute, then this method returns: the pipeline is done.
If the
max_exec argument is 0 or less, then the pipeline is executed
until none of the
CNKProc objects are ready to execute. If max_exec is
greater than
0, then the CNKPipeline::execute method will return
after calling
CNKProc::execute at most max_exec times.
Every time that the
CNKPipeline::execute method calls the
execute() method for a CNKProc, it also calls
CNKProc::incrementExecuteCount(), to update the count of the times
that the
CNKProc has been executed.
The
getAnyProcReady() method returns true (non-zero) if at least one
of the
CNKProc objects in the pipeline is ready to execute.
CNKPipeline::
Komentarze do niniejszej Instrukcji