Filter

Examples of using a Filter are described in Using A Filter.

Filter objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::interfaces::stream::Filter> rogue::interfaces::stream::FilterPtr

Shared pointer alias for Filter.

The class description is shown below:

class Filter : public rogue::interfaces::stream::Master, public rogue::interfaces::stream::Slave

Stream frame filter by channel and error state.

Used when frames may carry non-zero channel numbers (for example from data-file readers or batcher splitters). The filter forwards only matching-channel frames and can optionally drop frames marked with errors.

Public Functions

Filter(bool dropErrors, uint8_t channel)

Constructs a stream filter.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Parameters:
  • dropErrors – Set to true to drop frames with error flags.

  • channel – Channel number to allow through the filter.

~Filter()

Destroys the stream filter.

virtual void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame)

Receives a frame from upstream and applies filter rules.

Parameters:

frameFrame to evaluate and potentially forward.

Public Static Functions

static std::shared_ptr<rogue::interfaces::stream::Filter> create(bool dropErrors, uint8_t channel)

Creates a stream filter.

Parameter semantics are identical to the constructor; see Filter() for filter behavior details. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Parameters:
  • dropErrors – Set to true to drop frames with error flags.

  • channel – Channel number to allow through the filter.

Returns:

Shared pointer to the created filter.

static void setup_python()

Registers this type with Python bindings.