C++ Documentation

DataSamples

class DataSample

This class is the C++ variant of nexxT.interface.DataSamples.DataSample

Public Functions

DataSample(const QByteArray &content, const QString &datatype, int64_t timestamp)

Constructor, see nexxT.interface.DataSamples.DataSample.__init__()

virtual ~DataSample()

Destructor

QByteArray getContent() const

See nexxT.interface.DataSamples.DataSample.getContent()

int64_t getTimestamp() const

See nexxT.interface.DataSamples.DataSample.getTimestamp()

QString getDatatype() const

See nexxT.interface.DataSamples.DataSample.getDatatype()

Public Static Functions

static SharedDataSamplePtr copy(const SharedDataSamplePtr &src)

See nexxT.interface.DataSamples.DataSample.copy()

static SharedDataSamplePtr make_shared(DataSample *sample)

Return a shared pointer referencing the given instance. The ownership of the pointer is transferred to the shared pointer.

static int64_t currentTime()

See nexxT.interface.DataSamples.DataSample.currentTime()

Public Static Attributes

static const double TIMESTAMP_RES

The resolution of the timstamps in [seconds]

typedef QSharedPointer<const DataSample> nexxT::SharedDataSamplePtr

A typedef for a Datasample handled by a shared pointer.

Filters

class Filter : public QObject

This class is the C++ variant of nexxT.interface.Filters.Filter

Public Functions

virtual ~Filter()

Destructor

virtual void onInit()

See nexxT.interface.Filters.Filter.onInit()

virtual void onOpen()

See nexxT.interface.Filters.Filter.onOpen()

virtual void onStart()

See nexxT.interface.Filters.Filter.onStart()

virtual void onPortDataChanged(const InputPortInterface &inputPort)

See nexxT.interface.Filters.Filter.onPortDataChanged()

virtual void onStop()

See nexxT.interface.Filters.Filter.onStop()

virtual void onClose()

See nexxT.interface.Filters.Filter.onClose()

virtual void onDeinit()

See nexxT.interface.Filters.Filter.onDeinit()

virtual QList<QList<QString>> onSuggestDynamicPorts()

See nexxT.interface.Filters.Filter.onSuggestDynamicPorts()

BaseFilterEnvironment *environment() const

See nexxT.interface.Filters.Filter.environment()

Public Static Functions

static SharedFilterPtr make_shared(Filter *filter)

Return a shared pointer referencing the given instance. The ownership of the pointer is transferred to the shared pointer.

Protected Functions

Filter(bool dynInPortsSupported, bool dynOutPortsSupported, BaseFilterEnvironment *env)

Constructor, see nexxT.interface.Filters.Filter.__init__()

PropertyCollection *propertyCollection()

See nexxT.interface.Filters.Filter.propertyCollection()

PropertyCollection *guiState()

See nexxT.interface.Filters.Filter.guiState()

void addStaticPort(const SharedPortPtr &port)

See nexxT.interface.Filters.Filter.addStaticPort()

SharedPortPtr addStaticOutputPort(const QString &name)

See nexxT.interface.Filters.Filter.addStaticOutputPort()

SharedPortPtr addStaticInputPort(const QString &name, int queueSizeSamples = 1, double queueSizeSeconds = -1)

See nexxT.interface.Filters.Filter.addStaticInputPort()

void removeStaticPort(const SharedPortPtr &port)

See nexxT.interface.Filters.Filter.removeStaticPort()

PortList getDynamicInputPorts()

See nexxT.interface.Filters.Filter.getDynamicInputPorts()

PortList getDynamicOutputPorts()

See nexxT.interface.Filters.Filter.getDynamicOutputPorts()

struct FilterState

This struct is the C++ variant of nexxT.interface.Filters.FilterState

Public Static Functions

static QString state2str(int state)

See nexxT.interface.Filters.FilterState.state2str()

Public Static Attributes

static const int CONSTRUCTING = 0

During constructor.

static const int CONSTRUCTED = 1

After constructor before calling onInit.

static const int INITIALIZING = 2

During onInit.

static const int INITIALIZED = 3

After onInit before onOpen.

static const int OPENING = 4

During onOpen.

static const int OPENED = 5

After onOpen before onStart.

static const int STARTING = 6

During onStart.

static const int ACTIVE = 7

After onStart before onStop.

static const int STOPPING = 8

During onStop.

static const int CLOSING = 9

During onClose.

static const int DEINITIALIZING = 10

During onDeinit.

static const int DESTRUCTING = 11

During destructor.

static const int DESTRUCTED = 12

After destructor.

typedef QSharedPointer<Filter> nexxT::SharedFilterPtr

A typedef for a Filter instance handled by a shared pointer.

Ports

Port

class Port : public QObject

This class is the C++ variant of nexxT.interface.Ports.Port

Subclassed by nexxT::InputPortInterface, nexxT::OutputPortInterface

Public Functions

Port(bool dynamic, const QString &name, BaseFilterEnvironment *env)

Constructor, see nexxT.interface.Ports.Port.__init__()

virtual ~Port()

Destructor

bool dynamic() const

See nexxT.interface.Ports.Port.dynamic()

const QString &name() const

See nexxT.interface.Ports.Port.name()

void setName(const QString &name)

See nexxT.interface.Ports.Port.setName()

BaseFilterEnvironment *environment() const

See nexxT.interface.Ports.Port.environment()

bool isOutput() const

See nexxT.interface.Ports.Port.isOutput()

bool isInput() const

See nexxT.interface.Ports.Port.isInput()

virtual SharedPortPtr clone(BaseFilterEnvironment*) const = 0

See nexxT.interface.Ports.Port.clone()

Public Static Functions

static SharedPortPtr make_shared(Port *port)

Return a shared pointer referencing the given instance. The ownership of the pointer is transferred to the shared pointer.

typedef QSharedPointer<Port> nexxT::SharedPortPtr

A typedef for a Port instance handled by a shared pointer.

typedef QList<QSharedPointer<Port>> nexxT::PortList

A typedef for a list of ports.

OutputPortInterface

class OutputPortInterface : public nexxT::Port

This class is the C++ variant of nexxT.interface.Ports.OutputPortInterface.

In contrast to the python version, this class is not abstract but directly implements the functionality.

Public Functions

OutputPortInterface(bool dynamic, const QString &name, BaseFilterEnvironment *env)

Constructor.

See nexxT.interface.Ports.OutputPort().

void transmit(const SharedDataSamplePtr &sample)

See nexxT.interface.Ports.OutputPortInterface.transmit().

virtual SharedPortPtr clone(BaseFilterEnvironment*) const

See nexxT.interface.Ports.OutputPortInterface.clone().

Signals

void transmitSample(const QSharedPointer<const nexxT::DataSample> &sample)

QT signal for transmitting a sample over threads. Note that this signal is not intended to be used directly. Use the transmit method instead.

See nexxT.interface.Ports.OutputPortInterface.transmitSample.

Public Static Functions

static void setupDirectConnection(const SharedPortPtr&, const SharedPortPtr&)

Called by the nexxT framework, not intended to be used directly.

static QObject *setupInterThreadConnection(const SharedPortPtr&, const SharedPortPtr&, QThread&, int width)

Called by the nexxT framework, not intended to be used directly.

typedef QSharedPointer<OutputPortInterface> nexxT::SharedOutputPortPtr

A typedef for a Port instance handled by a shared pointer.

InputPortInterface

class InputPortInterface : public nexxT::Port

This class is the C++ variant of nexxT.interface.Ports.InputPortInterface.

In contrast to the python version, this class is not abstract but directly implements the functionality.

Public Functions

InputPortInterface(bool dynamic, const QString &name, BaseFilterEnvironment *env, int queueSizeSamples = 1, double queueSizeSeconds = -1.0)

Constructor.

See nexxT.interface.Ports.InputPort().

virtual ~InputPortInterface()

Destructor

SharedDataSamplePtr getData(int delaySamples = 0, double delaySeconds = -1.) const

See nexxT.interface.Ports.InputPortInterface.getData().

virtual SharedPortPtr clone(BaseFilterEnvironment*) const

See nexxT.interface.Ports.InputPortInterface.clone().

void setQueueSize(int queueSizeSamples, double queueSizeSeconds)

See nexxT.interface.Ports.InputPortInterface.setQueueSize().

int queueSizeSamples()

See nexxT.interface.Ports.InputPortInterface.queueSizeSamples().

double queueSizeSeconds()

See nexxT.interface.Ports.InputPortInterface.queueSizeSeconds().

void setInterthreadDynamicQueue(bool enabled)

See nexxT.interface.Ports.InputPortInterface.setInterthreadDynamicQueue().

bool interthreadDynamicQueue()

See nexxT.interface.Ports.InputPortInterface.interthreadDynamicQueue().

Public Slots

void receiveAsync(const QSharedPointer<const nexxT::DataSample> &sample, QSemaphore *semaphore, bool isPending = false)

Called by the nexxT framework, not intended to be used directly.

void receiveSync(const QSharedPointer<const nexxT::DataSample> &sample)

Called by the nexxT framework, not intended to be used directly.

typedef QSharedPointer<InputPortInterface> nexxT::SharedInputPortPtr

A typedef for an InputPortInterface instance handled by a shared pointer.

A typedef for a Port instance handled by a shared pointer.

PropertyCollections

PropertyCollection

class PropertyCollection : public QObject

This class is the C++ variant ofnexxT.interface.PropertyCollections.PropertyCollection

Public Functions

PropertyCollection()

Constructor

virtual ~PropertyCollection()

Destructor

virtual void defineProperty(const QString &name, const QVariant &defaultVal, const QString &helpstr)

SeenexxT.interface.PropertyCollections.PropertyCollection.defineProperty()

Variant with no options and no handler.

virtual void defineProperty(const QString &name, const QVariant &defaultVal, const QString &helpstr, const QVariantMap &options)

SeenexxT.interface.PropertyCollections.PropertyCollection.defineProperty()

Variant with options. C++ example

defineProperty("intProp", 1, "a bound integer", {{"min", -4},{"max", 9}});
defineProperty("enumProp", "Hello", "an enum prop", {{"enum", QStringList{"Hello", "World"}}});

virtual void defineProperty(const QString &name, const QVariant &defaultVal, const QString &helpstr, const PropertyHandler *handler)

SeenexxT.interface.PropertyCollections.PropertyCollection.defineProperty()

Variant with a custom handler.

virtual QVariant getProperty(const QString &name) const

SeenexxT.interface.PropertyCollections.PropertyCollection.getProperty()

Public Slots

virtual void setProperty(const QString &name, const QVariant &variant)

Called from the nexxT framework, not intended to be used publicly

virtual QString evalpath(const QString &path) const

SeenexxT.interface.PropertyCollections.PropertyCollection.evalpath()

Signals

void propertyChanged(nexxT::PropertyCollection *sender, const QString &name)

SeenexxT.interface.PropertyCollections.PropertyCollection.propertyChanged

PropertyHandler

class PropertyHandler

This class is the C++ variant ofnexxT.interface.PropertyCollections.PropertyHandler

Public Functions

PropertyHandler()

Constructor

virtual ~PropertyHandler()

Destructor

virtual QVariantMap options()

SeenexxT.interface.PropertyCollections.PropertyHandler.options()

The python dict is translated to a QVariantMap in the C++ world.

virtual QVariant fromConfig(const QVariant &value)

SeenexxT.interface.PropertyCollections.PropertyHandler.fromConfig()

virtual QVariant toConfig(const QVariant &value)

SeenexxT.interface.PropertyCollections.PropertyHandler.toConfig()

virtual QVariant toViewValue(const QVariant &value)

SeenexxT.interface.PropertyCollections.PropertyHandler.toViewValue()

virtual QWidget *createEditor(QWidget *parent)

SeenexxT.interface.PropertyCollections.PropertyHandler.createEditor()

virtual void setEditorData(QWidget *editor, const QVariant &value)

SeenexxT.interface.PropertyCollections.PropertyHandler.setEditorData()

virtual QVariant getEditorData(QWidget *editor)

SeenexxT.interface.PropertyCollections.PropertyHandler.getEditorData()

Services

class Services

This class is the C++ variant of nexxT.interface.Services.Services

Public Functions

Services()

Constructor (intended to be used by the nexxT framework only)

virtual ~Services()

Destructor

Public Static Functions

static SharedQObjectPtr getService(const QString &name)

See nexxT.interface.Services.Services.getService()

static void addService(const QString &name, QObject *service)

See nexxT.interface.Services.Services.addService()

This function takes ownership of the given QObject instance.

static void addService(const QString &name, const SharedQObjectPtr &service)

See nexxT.interface.Services.Services.addService()

This function uses a shared pointer to the object and therefore doesn’t suffer from ownership issues. A common use case for this is to add a filter as a service, the shared pointer to the filter is available with environment()->getPlugin() from within the filter.

static void removeService(const QString &name)

See nexxT.interface.Services.Services.removeService()

static void removeAll()

See nexxT.interface.Services.Services.removeAll()

typedef QSharedPointer<QObject> nexxT::SharedQObjectPtr

A typedef for a QObject handled by a shared pointer.

In principle it is not really necessary to use a shared pointer to handle QObjects, because of the parent/child ownership principle. However for consistency, the design decision has been made to also wrap the services in a smart pointer just like datasamples, filters and ports.

Logging

NEXXT_LOG_INTERNAL(msg)

Log msg using the nexxT mechanism with priority INTERNAL (lowest)

Parameters:
  • msg – QString instance

NEXXT_LOG_DEBUG(msg)

Log msg using the nexxT mechanism with priority DEBUG

Parameters:
  • msg – QString instance

NEXXT_LOG_INFO(msg)

Log msg using the nexxT mechanism with priority INFO

Parameters:
  • msg – QString instance

NEXXT_LOG_WARN(msg)

Log msg using the nexxT mechanism with priority WARNING

Parameters:
  • msg – QString instance

NEXXT_LOG_ERROR(msg)

Log msg using the nexxT mechanism with priority ERROR

Parameters:
  • msg – QString instance

NEXXT_LOG_CRITICAL(msg)

Log msg using the nexxT mechanism with priority CRITICAL (highest)

Parameters:
  • msg – QString instance

Plugin Definition

NEXXT_PLUGIN_DECLARE_FILTER(classname)

This macro must be present in the Filter’s class declaration.

Parameters:
  • classname – the name of the Filter class

NEXXT_PLUGIN_DEFINE_START()

Start to define the plugin introspection code section. To define the introspection code section, one of the .cpp files must call these macros once:

NEXXT_PLUGIN_DEFINE_START()
NEXXT_PLUGIN_ADD_FILTER(...)
NEXXT_PLUGIN_ADD_FILTER(...)
NEXXT_PLUGIN_ADD_FILTER(...)
NEXXT_PLUGIN_DEFINE_FINISH()

NEXXT_PLUGIN_ADD_FILTER(filtertype)

Add the given filtertype to the plugin

Parameters:
  • filtertype – the name of the Filter class

NEXXT_PLUGIN_DEFINE_FINISH()

Finish the plugin introspection code section