Into

Modules

Documentation

classPiiSequenceGenerator

#include <PiiSequenceGenerator.h>

An operation that generates sequences of numbers.

Inherits PiiDefaultOperation

Description

The sequence goes from sequenceStart to sequenceEnd, stepping step units each time.

Inputs

triggeran optional input that triggers the emission.

Outputs

outputa number in the sequence.

Properties

bool

The data type of the output.

int

The number of times the sequence will be repeated.

double

The last value in the sequence.

The sequence mode.

double

The first value in the sequence.

double

The increment on each iteration.

Public types

enum
{ Repeat, BackAndForth }

Sequence modes.

Constructors and destructor

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

bool
int
double
double
void
(
  • bool integerOutput
)
void
(
  • int repeatCount
)
void
(
  • double sequenceEnd
)
void
( )
void
(
  • double sequenceStart
)
void
(
  • double step
)
double
( )

Protected member functions

virtual void

Executes one round of processing.

Property details

  • bool integerOutput

    [read, write]

    The data type of the output.

    By default, this value is false and doubles will be emitted. Setting this value to true causes converts the output to ints.

  • int repeatCount

    [read, write]

    The number of times the sequence will be repeated.

    Once this count is reached, the operation will send a stop signal which will stop the whole execution engine if properly connected. The default value is zero, which means "eternally". This value has no effect if trigger is connected.

  • double sequenceEnd

    [read, write]

    The last value in the sequence.

    The default value is 1. This value must be larger than or equal to sequenceStart.

  • SequenceMode sequenceMode

    [read, write]

    The sequence mode.

    The default mode is Repeat.

  • double sequenceStart

    [read, write]

    The first value in the sequence.

    The default value is 0. This value must be less than or equal to sequenceEnd.

  • double step

    [read, write]

    The increment on each iteration.

    Use a negative value to go backwards.

Enumeration details

  • enum SequenceMode

    Sequence modes.

Function details

  • PiiSequenceGenerator

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

  • bool integerOutput

    ()
  • int repeatCount

    ()
  • double sequenceEnd

    ()
  • SequenceMode sequenceMode

    ()
  • double sequenceStart

    ()
  • void setIntegerOutput

    (
    • bool integerOutput
    )
  • void setRepeatCount

    (
    • int repeatCount
    )
  • void setSequenceEnd

    (
    • double sequenceEnd
    )
  • void setSequenceMode

    ( )
  • void setSequenceStart

    (
    • double sequenceStart
    )
  • void setStep

    (
    • double step
    )
  • double step

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

Notes (0)

Add a note

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