Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
Loading...
Searching...
No Matches
auterion::ObjectDetectionEnabledSubscription Class Reference

A class for managing subscriptions to object detection service state changes. More...

#include <auterion_sdk/object_detection/object_detection_provider.hpp>

Public Member Functions

 ObjectDetectionEnabledSubscription (const std::shared_ptr< class ObjectDetectionEnabledSubscriptionImpl > &impl)
 Construct a new ObjectDetectionEnabledSubscription object.
 
void onUpdate (ObjectDetectionEnabledCallback callback)
 Registers a callback function to be called when the object detection enabled state changes.
 
void subscribe (ObjectDetectionEnabledCallback callback=nullptr)
 Activates the subscription process and registers a callback function if provided.
 
bool last () const
 Retrieves the last received object detection enabled state.
 
bool isLastValid () const
 Checks if the last received object detection state is valid.
 

Detailed Description

A class for managing subscriptions to object detection service state changes.

This class enables providers to respond to object detection enabled/disabled state by controlling their computational workload accordingly.

Constructor & Destructor Documentation

◆ ObjectDetectionEnabledSubscription()

auterion::ObjectDetectionEnabledSubscription::ObjectDetectionEnabledSubscription ( const std::shared_ptr< class ObjectDetectionEnabledSubscriptionImpl > &  impl)

Construct a new ObjectDetectionEnabledSubscription object.

Parameters
implThe implementation pointer.

Member Function Documentation

◆ isLastValid()

bool auterion::ObjectDetectionEnabledSubscription::isLastValid ( ) const

Checks if the last received object detection state is valid.

Returns
True if the last received object detection state is valid, false otherwise.

◆ last()

bool auterion::ObjectDetectionEnabledSubscription::last ( ) const

Retrieves the last received object detection enabled state.

Returns
The last received object detection enabled state.
Exceptions
auterion::AccessExceptionif no data has been received yet.

◆ onUpdate()

void auterion::ObjectDetectionEnabledSubscription::onUpdate ( ObjectDetectionEnabledCallback  callback)

Registers a callback function to be called when the object detection enabled state changes.

This method does not start the subscription process itself.

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

◆ subscribe()

void auterion::ObjectDetectionEnabledSubscription::subscribe ( ObjectDetectionEnabledCallback  callback = nullptr)

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

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

Parameters
callbackCallback function to handle object detection enabled updates.

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