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
Outputs
Properties
|
int
|
Change in object rate. |
Constructors and destructor
Public member functions
|
virtual void
|
(
Checks the operation for execution. |
Protected member functions
|
virtual void
|
( )
Executes one round of processing. |
|
int
|
( )
|
|
void
|
(
|
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
rateChangetimes. 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]
Add a note
Not a single note added yet. Be the first, add yours.