Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
auterion::Detections2DSubscription Class Reference

A class for managing subscriptions to 2D object detections. More...

#include <auterion_sdk/object_detection/object_detection_client.hpp>

Public Member Functions

 Detections2DSubscription (const std::shared_ptr< class Detections2DSubscriptionImpl > &impl)
 Construct a new Detections2DSubscription object. More...
 
void onUpdate (Detections2DCallback callback)
 Registers a callback function to be called when new detections are received. More...
 
void subscribe (Detections2DCallback callback=nullptr)
 Activates the subscription process and registers a callback function if provided. More...
 
ImageDetections2D last () const
 Retrieves the last received detections. More...
 
bool isLastValid () const
 Checks if the last received detections are valid. More...
 

Detailed Description

A class for managing subscriptions to 2D object detections.

Constructor & Destructor Documentation

◆ Detections2DSubscription()

auterion::Detections2DSubscription::Detections2DSubscription ( const std::shared_ptr< class Detections2DSubscriptionImpl > &  impl)

Construct a new Detections2DSubscription object.

Parameters
implThe implementation pointer.

Member Function Documentation

◆ isLastValid()

bool auterion::Detections2DSubscription::isLastValid ( ) const

Checks if the last received detections are valid.

Returns
True if the last received detections are valid, false otherwise.

◆ last()

ImageDetections2D auterion::Detections2DSubscription::last ( ) const

Retrieves the last received detections.

Returns
The last received detections.
Exceptions
auterion::AccessExceptionif no data has been received yet.

◆ onUpdate()

void auterion::Detections2DSubscription::onUpdate ( Detections2DCallback  callback)

Registers a callback function to be called when new detections are received.

This method does not start the subscription process itself.

Parameters
callbackCallback function to handle detection updates.
Exceptions
auterion::InvalidArgumentExceptionif the callback function is nullptr.

◆ subscribe()

void auterion::Detections2DSubscription::subscribe ( Detections2DCallback  callback = nullptr)

Activates the subscription process and registers a callback function if provided.

If a callback function is provided, it registers it for detection updates. If the callback is nullptr, only activates the subscription process.

Parameters
callbackCallback function to handle detection updates.

The documentation for this class was generated from the following file: