Classes | Public Member Functions | Protected Types | Protected Attributes | List of all members
rokubimini::Statusword Class Reference

Class representing the different states the communication or the sensors can be in. More...

#include <Statusword.hpp>

Classes

union  Data
 Data associated with a Status Word. More...
 
struct  DataBits
 Bits representing errors. More...
 

Public Member Functions

double getAge () const
 Gets the age variable. More...
 
uint32_t getData () const
 Gets the data variable. More...
 
void getMessages (std::vector< std::string > &infos, std::vector< std::string > &warnings, std::vector< std::string > &errors, std::vector< std::string > &fatals) const
 Gets all the messages relevant to statuswords. More...
 
void getMessagesDiff (Statusword &previousStatusword, std::vector< std::string > &infos, std::vector< std::string > &warnings, std::vector< std::string > &errors, std::vector< std::string > &fatals) const
 Gets the different messages form the previous statusword. More...
 
TimePoint getStamp () const
 Gets the stamp variable. More...
 
bool hasErrorAccSaturated () const
 Checks if the statusword has error ACC saturated. More...
 
bool hasErrorAdcOutOfSync () const
 Checks if the statusword has error ADC out-of-sync. More...
 
bool hasErrorAdcSaturated () const
 Checks if the statusword has error ADC saturated. More...
 
bool hasErrorGyroSaturated () const
 Checks if the statusword has error gyro saturated. More...
 
bool hasErrorSensingRangeExceeded () const
 Checks if the statusword has error sensing range exceeded. More...
 
bool hasFatalSupplyVoltage () const
 Checks if the statusword has fatal supply voltage. More...
 
bool hasWarningOvertemperature () const
 Checks if the statusword has warning over temperature. More...
 
bool isEmpty () const
 Checks whether the statusword is empty. More...
 
Statuswordoperator= (const Statusword &statusword)
 Assignment operator. More...
 
void setData (const uint32_t data)
 Sets the data variable. More...
 
 Statusword ()=default
 Default constructor. More...
 
 Statusword (const Statusword &statusword)
 Copy constructor. More...
 
 Statusword (const uint32_t data)
 Explicit constructor. More...
 
virtual ~Statusword ()=default
 

Protected Types

using Duration = std::chrono::duration< double >
 
using TimePoint = std::chrono::system_clock::time_point
 

Protected Attributes

Data data_
 The data variable. More...
 
std::recursive_mutex mutex_
 Mutex enabling synchronization. More...
 
TimePoint stamp_
 Timestamp associated with the Data. More...
 

Detailed Description

Class representing the different states the communication or the sensors can be in.

Definition at line 20 of file Statusword.hpp.

Member Typedef Documentation

using rokubimini::Statusword::Duration = std::chrono::duration<double>
protected

Definition at line 110 of file Statusword.hpp.

using rokubimini::Statusword::TimePoint = std::chrono::system_clock::time_point
protected

Definition at line 109 of file Statusword.hpp.

Constructor & Destructor Documentation

rokubimini::Statusword::Statusword ( )
default

Default constructor.

rokubimini::Statusword::Statusword ( const Statusword statusword)

Copy constructor.

Parameters
statuswordThe statusword to copy from.

Definition at line 20 of file Statusword.cpp.

rokubimini::Statusword::Statusword ( const uint32_t  data)
explicit

Explicit constructor.

Parameters
dataData to be copied to the internal variable.

Definition at line 24 of file Statusword.cpp.

virtual rokubimini::Statusword::~Statusword ( )
virtualdefault

Member Function Documentation

double rokubimini::Statusword::getAge ( ) const

Gets the age variable.

Returns
The age value.

Definition at line 43 of file Statusword.cpp.

uint32_t rokubimini::Statusword::getData ( ) const

Gets the data variable.

Returns
The data value.

Definition at line 63 of file Statusword.cpp.

void rokubimini::Statusword::getMessages ( std::vector< std::string > &  infos,
std::vector< std::string > &  warnings,
std::vector< std::string > &  errors,
std::vector< std::string > &  fatals 
) const

Gets all the messages relevant to statuswords.

Parameters
infosThe info messages list.
warningsThe warning messages list.
errorsThe error messages list.
fatalsThe fatal messages list.

Definition at line 82 of file Statusword.cpp.

void rokubimini::Statusword::getMessagesDiff ( Statusword previousStatusword,
std::vector< std::string > &  infos,
std::vector< std::string > &  warnings,
std::vector< std::string > &  errors,
std::vector< std::string > &  fatals 
) const

Gets the different messages form the previous statusword.

Parameters
previousStatuswordThe previous statusword.
infosThe info messages list.
warningsThe warning messages list.
errorsThe error messages list.
fatalsThe fatal messages list.

Definition at line 89 of file Statusword.cpp.

Statusword::TimePoint rokubimini::Statusword::getStamp ( ) const

Gets the stamp variable.

Returns
The stamp value.

Definition at line 50 of file Statusword.cpp.

bool rokubimini::Statusword::hasErrorAccSaturated ( ) const

Checks if the statusword has error ACC saturated.

Returns
True if the statusword has error ACC saturated.

Definition at line 162 of file Statusword.cpp.

bool rokubimini::Statusword::hasErrorAdcOutOfSync ( ) const

Checks if the statusword has error ADC out-of-sync.

Returns
True if the statusword has error ADC out-of-sync.

Definition at line 174 of file Statusword.cpp.

bool rokubimini::Statusword::hasErrorAdcSaturated ( ) const

Checks if the statusword has error ADC saturated.

Returns
True if the statusword has error ADC saturated.

Definition at line 156 of file Statusword.cpp.

bool rokubimini::Statusword::hasErrorGyroSaturated ( ) const

Checks if the statusword has error gyro saturated.

Returns
True if the statusword has error gyro saturated.

Definition at line 168 of file Statusword.cpp.

bool rokubimini::Statusword::hasErrorSensingRangeExceeded ( ) const

Checks if the statusword has error sensing range exceeded.

Returns
True if the statusword has error sensing range exceeded.

Definition at line 180 of file Statusword.cpp.

bool rokubimini::Statusword::hasFatalSupplyVoltage ( ) const

Checks if the statusword has fatal supply voltage.

Returns
True if the statusword has fatal supply voltage.

Definition at line 192 of file Statusword.cpp.

bool rokubimini::Statusword::hasWarningOvertemperature ( ) const

Checks if the statusword has warning over temperature.

Returns
True if the statusword has warning over temperature.

Definition at line 186 of file Statusword.cpp.

bool rokubimini::Statusword::isEmpty ( ) const

Checks whether the statusword is empty.

Returns
True if it's empty.

Definition at line 37 of file Statusword.cpp.

Statusword & rokubimini::Statusword::operator= ( const Statusword statusword)

Assignment operator.

Parameters
statuswordThe statusword to assign.
Returns
A reference to the existing statusword.

Definition at line 29 of file Statusword.cpp.

void rokubimini::Statusword::setData ( const uint32_t  data)

Sets the data variable.

Parameters
dataThe value to set.

Definition at line 56 of file Statusword.cpp.

Member Data Documentation

Data rokubimini::Statusword::data_
protected

The data variable.

Definition at line 134 of file Statusword.hpp.

std::recursive_mutex rokubimini::Statusword::mutex_
mutableprotected

Mutex enabling synchronization.

Definition at line 118 of file Statusword.hpp.

TimePoint rokubimini::Statusword::stamp_
protected

Timestamp associated with the Data.

Definition at line 126 of file Statusword.hpp.


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


rokubimini
Author(s):
autogenerated on Wed Mar 3 2021 03:09:12