CVB++ 14.0
NotifyObservable Class Reference

Single notify event observable. More...

#include <cvb/driver/notify_observable.hpp>

Public Member Functions

int ID () const noexcept
 Get the native ID. More...
 
String Description () const noexcept
 The string identifier of this event. More...
 
bool IsAvailable () const
 Gets whether the current device can actually handle this event. More...
 
EventCookie RegisterEvent (std::function< void(NotifyArgs)> handler)
 Register a listener to this observable. More...
 
void UnregisterEvent (EventCookie eventCookie) noexcept
 Manually unregister a listener to this observable. More...
 

Detailed Description

Single notify event observable.

Member Function Documentation

◆ Description()

String Description ( ) const
inlinenoexcept

The string identifier of this event.

Returns
The identifier.
Exceptions
Doesnot throw any exception.

◆ ID()

int ID ( ) const
inlinenoexcept

Get the native ID.

Returns
The ID.
Exceptions
Doesnot throw any exception.

◆ IsAvailable()

bool IsAvailable ( ) const
inline

Gets whether the current device can actually handle this event.

Returns
True if available, false otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ RegisterEvent()

EventCookie RegisterEvent ( std::function< void(NotifyArgs)>  handler)
inline

Register a listener to this observable.

Parameters
[in]handlerListener, to this observable.
Returns
Event cookie, to manually unregister the listener.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UnregisterEvent()

void UnregisterEvent ( EventCookie  eventCookie)
inlinenoexcept

Manually unregister a listener to this observable.

Parameters
[in]eventCookieEvent cookie, obtained from registering the listener.
Exceptions
Doesnot throw any exception.