Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::sm::Notifier< T > Class Template Reference

State changing notifier wrapper. More...

#include <notifier.h>

Public Member Functions

 Notifier (T &state)
 Constructor. More...
 
 Notifier (const Notifier &)=delete
 
 Notifier (Notifier &&)=delete
 
Notifieroperator= (const Notifier &)=delete
 
Notifieroperator= (Notifier &&)=delete
 
Read () const noexcept
 Read the current state. More...
 
void Subscribe (NotificationHandler< T > handler)
 Subscribe to the state change. More...
 
void Notify ()
 Notify state change. More...
 

Detailed Description

template<typename T>
class ara::sm::Notifier< T >

State changing notifier wrapper.

Template Parameters
TState type

Constructor & Destructor Documentation

◆ Notifier()

template<typename T >
ara::sm::Notifier< T >::Notifier ( T &  state)
inline

Constructor.

Parameters
stateState

Member Function Documentation

◆ Notify()

template<typename T >
void ara::sm::Notifier< T >::Notify ( )
inline

Notify state change.

Note
This method should be called explicitly when the state changes

◆ Read()

template<typename T >
T ara::sm::Notifier< T >::Read ( ) const
inlinenoexcept

Read the current state.

Returns
Current state

◆ Subscribe()

template<typename T >
void ara::sm::Notifier< T >::Subscribe ( NotificationHandler< T >  handler)
inline

Subscribe to the state change.

Parameters
handlerHandler to be invoked when the state changes