Into

Modules

Documentation

classPiiOneInputFlowController

#include <PiiOneInputFlowController.h>

A flow controller that does not handle synchronization between sibling sockets.

Inherits PiiFlowController

Description

PiiOneInputFlowController can be used with operations that have only one connected input.

Constructors and destructor

Create a new flow controller.

Public member functions

Prepare the sockets for processing.

Function details

  • PiiOneInputFlowController

    ( )

    Create a new flow controller.

    Parameters
    input
    outputs

    the a list of outputs to be controlled. The class will only consider outputs whose group ID matches that of the input.

  • virtual PiiFlowController::FlowState prepareProcess

    ()
    [virtual]

    Prepare the sockets for processing.

    This function is called by PiiOperationProcessor just before it starts a processing round. If processing can be performed, this function places the necessary objects into the input sockets.

    If you reimplement this function yourself, you must conform to the following:

    • If any of the connected sockets in a group does not contain an object, IncompleteState must be returned.

    • If all inputs contain sync tags, they need to be passed to synchronized outputs (PiiOutputSocket::emitObject()) and SynchronizedState must be returned. The inputs must be released (PiiInputSocket::release()).

    • If all inputs contain stop/pause/resume tags, the operation must be either stopped, paused or resumed. The function must return FinishedState, PausedState, or ResumedState, respectively. The caller is responsible for passing the control objects in these cases. PiiOperationProcessor uses PiiBasicOperation::operationStopped(), PiiBasicOperation::operationPaused(), and PiiBasicOperation::operationResumed() helper functions for this. The inputs must be released.

    • If all inputs in a group contain ordinary objects (PiiYdin::isNonControlType()), move objects to be processed from incoming to outgoing slots with PiiInputSocket::release() and return ProcessableState. Only one group can be processed at once. The caller is responsible for re-invoking this function to make sure all processable groups will be handled. Set the active group to the group id of the active group.

    • If a group of synchronized inputs contains mixed inputs (e.g. ordinary objects and sync tags), a PiiExecutionException must be thrown.

    • Synchronization events (if any) should be queued. The sendSyncEvents(SyncListener*) function empties the queue.

    Returns

    If all inputs contain stop, pause, or resume tags, either FinishedState or PausedState, or ResumedState will be returned. Otherwise, returns ProcessableState when a processing round can be performed and IncompleteState when not. Processing can be performed if a group of synchronized sockets is filled with ordinary objects. If a group is filled with synchronization objects, SynchronizedState will be returned.

    Exceptions
    PiiExecutionException&

    if a synchronization error occurs or the listener's inputInSync() function throws.

    Reimplemented from PiiFlowController.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.