Into

Modules

Documentation

classPiiObjectCapturer

#include <PiiObjectCapturer.h>

Emits a received objects as a Qt signal.

Inherits PiiDefaultOperation

Description

Inputs

syncsync input. Any type. If this input is not connected, each incoming object (or a set of objects) will be sent once received. If this input is connected, every object related to the sync object will be sent once everything has been received.
inputXreads in objects of any type. X ranges from 1 to dynamicInputCount - 1. input0 can also be accessed as input.

Properties

int

The number of dynamic inputs (in addition to sync).

Signals

void
( )

Emitted for each incoming object if the sync input is not connected and if dynamicInputCount is one.

void
(
  • const PiiVariant & syncObject
  • const QVariantList & objects
)

Emitted when everything related to the object in the sync input has been received.

void
(
  • const QVariantList & objects
)

Emitted for each incoming object if the sync input is not connected and if dynamicInputCount is greater than one.

Constructors and destructor

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

virtual PiiInputSocket *
( )

Aliases input to input0.

Protected member functions

int
virtual void

Executes one round of processing.

void
(
  • int dynamicInputCount
)
virtual void
( )

Informs the operation about synchronization events.

Property details

  • int dynamicInputCount

    [read, write]

    The number of dynamic inputs (in addition to sync).

    The default is one.

Function details

  • PiiObjectCapturer

    ()
  • ~PiiObjectCapturer

    ()
  • virtual void check

    (
    • bool reset
    )
    [virtual]

    Checks the operation for execution.

    This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.

    If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.

    Reimplemented from PiiDefaultOperation.

  • virtual PiiInputSocket * input

    ( )
    [virtual]

    Aliases input to input0.

    Reimplemented from PiiBasicOperation.

  • int dynamicInputCount

    ()
    [protected]
  • virtual void process

    ()
    [protected, virtual]

    Executes one round of processing.

    This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.

    Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().

    Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns Running.

    Exceptions
    PiiExecutionException

    whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.

    Reimplemented from PiiDefaultOperation.

  • void setDynamicInputCount

    (
    • int dynamicInputCount
    )
    [protected]
  • virtual void syncEvent

    ( )
    [protected, virtual]

    Informs the operation about synchronization events.

    The most typical use of this function is to see when all objects in an input group and all of its child groups have been received. For example, if the operation reads large images from one input and a number of sub-images for each large image from another input, a sync event is sent whenever all the small images that correspond to one large image have been processed. Your implementation may then either just record the synchronized state or to send any buffered data. The default implementation does nothing.

    Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling syncEvent().

     void MyOperation::syncEvent(SyncEvent* event)
     {
       if (event->type() == SyncEvent::EndInput &&
           event->groupId() == _pLargeImageInput->groupId())
         doWhateverNeededNow();
     }
    

    Reimplemented from PiiDefaultOperation.

  • void objectCaptured

    ( )
    [signal]

    Emitted for each incoming object if the sync input is not connected and if dynamicInputCount is one.

  • void objectsCaptured

    (
    • const PiiVariant & syncObject
    • const QVariantList & objects
    )
    [signal]

    Emitted when everything related to the object in the sync input has been received.

  • void objectsCaptured

    (
    • const QVariantList & objects
    )
    [signal]

    Emitted for each incoming object if the sync input is not connected and if dynamicInputCount is greater than one.

    Each element in the list will be a PiiVariant. The first object is the one read from input0 and so on.

Notes (0)

Add a note

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