RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rtctk::componentFramework::AlertSource Class Reference

Models a single alert source that can be set or cleared. More...

#include <rtctk/componentFramework/alertServiceIf.hpp>

Public Member Functions

 AlertSource ()
 
 AlertSource (AlertStatus &status, const std::string &id, const std::string &text)
 
 ~AlertSource ()
 Resets alert.
 
 AlertSource (const AlertSource &other)=delete
 No copy of alert sources allowed, they must be moved.
 
AlertSourceoperator= (const AlertSource &other)=delete
 
 AlertSource (AlertSource &&other) noexcept=default
 Move constructs from other to this object.
 
AlertSourceoperator= (AlertSource &&other) noexcept=default
 Move assigns from other to this object.
 
std::string GetId () const
 Get the alert identifier.
 
std::string GetText () const
 Get the alert condition description.
 
void Set (bool state=true)
 Set alert status state.
 
void Clear ()
 Clear alert.
 
bool IsSet ()
 Query alert status.
 

Detailed Description

Models a single alert source that can be set or cleared.

Instances should be created from AlertServiceIf::MakeAlertSource.

Changes to the state are emitted as signal to connected observers.

Thread Safety
thread-safe

Constructor & Destructor Documentation

◆ AlertSource() [1/4]

rtctk::componentFramework::AlertSource::AlertSource ( )

◆ AlertSource() [2/4]

rtctk::componentFramework::AlertSource::AlertSource ( AlertStatus & status,
const std::string & id,
const std::string & text )

◆ ~AlertSource()

rtctk::componentFramework::AlertSource::~AlertSource ( )

Resets alert.

◆ AlertSource() [3/4]

rtctk::componentFramework::AlertSource::AlertSource ( const AlertSource & other)
delete

No copy of alert sources allowed, they must be moved.

◆ AlertSource() [4/4]

rtctk::componentFramework::AlertSource::AlertSource ( AlertSource && other)
defaultnoexcept

Move constructs from other to this object.

Postcondition
Other is in a moved-from state where it is only safe to destroy or move-assign it.

Member Function Documentation

◆ Clear()

void rtctk::componentFramework::AlertSource::Clear ( )

Clear alert.

If alert changes state the signal is emitted.

Postcondition
IsSet() == false

◆ GetId()

std::string rtctk::componentFramework::AlertSource::GetId ( ) const

Get the alert identifier.

◆ GetText()

std::string rtctk::componentFramework::AlertSource::GetText ( ) const

Get the alert condition description.

◆ IsSet()

bool rtctk::componentFramework::AlertSource::IsSet ( )

Query alert status.

Returns
true if alert is set.

◆ operator=() [1/2]

AlertSource & rtctk::componentFramework::AlertSource::operator= ( AlertSource && other)
defaultnoexcept

Move assigns from other to this object.

Postcondition
Other is in a moved-from state where it is only safe to destroy or move-assign it.

◆ operator=() [2/2]

AlertSource & rtctk::componentFramework::AlertSource::operator= ( const AlertSource & other)
delete

◆ Set()

void rtctk::componentFramework::AlertSource::Set ( bool state = true)

Set alert status state.

If alert changes state the signal is emitted.

Parameters
statenew alert state.
Postcondition
IsSet() == state

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