Into

Modules

Documentation

classPiiObjectRateChanger

#include <PiiObjectRateChanger.h>

Replicate or sample input objects.

Inherits PiiDefaultOperation

Description

Depending on the value of rateChange, this operation either replicates each input object N times or passes just every Nth object.

Inputs

inputany object

Outputs

outputinput objects, replicated or sampled

Properties

int

Change in object rate.

Constructors and destructor

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

Protected member functions

virtual void

Executes one round of processing.

int
void
(
  • int rateChange
)

Property details

  • int rateChange

    [read, write]

    Change in object rate.

    The default value is 0 which causes every input object to be passed as such. If this value is greater than zero, every object will be sent rateChange times. If the value is less than zero, abs(rateChange) objects will be skipped after each passed object. For example, a rate change of -1 means that every second object will be passed, starting from the second one.

Function details

  • PiiObjectRateChanger

    ()
  • 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 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.

  • int rateChange

    ()
    [protected]
  • void setRateChange

    (
    • int rateChange
    )
    [protected]
Notes (0)

Add a note

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