TReK C++  5.3.2
Telemetry/Command API
trek::ExpectedStateAlarm Class Reference

This class checks expected state violations. More...

#include <expected_state_alarm.h>

Inherits trek::NamedItem.

Public Member Functions

void SetExpectedState (const char *input)
 Sets the expected type for the alarm.
 
const char * GetExpectedState ()
 Gets the expected type for the alarm. More...
 
Constructors, Destructor, and Other Basic Methods
 ExpectedStateAlarm ()
 Default constructor of the class.
 
virtual ~ExpectedStateAlarm ()
 Class destructor. More...
 
ExpectedStateAlarmClone ()
 Creates and returns an extact copy of the object.
 
void operator= (ExpectedStateAlarm &right_side)
 Provides the equal operator.
 
virtual void Init ()
 Initializes the object.
 
Methods to Check for Violations
int32_t Check (const char *enum_str, ParameterStatus &status)
 Checks the supplied string value for an expected state violation. More...
 
Serialization Methods

These methods help read and write the class to disk or memory. Most users will not be interested in these. Those that are can continue reading.

int32_t LoadFile (const char *filename)
 Loads the ExpectedStateAlarm definition from the specified file. More...
 
int32_t SaveFile (const char *filename)
 Saves the ExpectedStateAlarm definition to the specified file. More...
 
- Public Member Functions inherited from trek::NamedItem
void SetName (const char *input_ptr)
 Sets the name of the item. More...
 
void SetAlias (const char *input)
 Sets the alias of the item. More...
 
void SetShortDescription (const char *input_ptr)
 Sets the short description of the item. More...
 
void SetLongDescription (const char *input_ptr)
 Sets the long description of the item. More...
 
void SetUserDescription (const char *input_ptr)
 Sets the user description of the item. More...
 
void SetOwner (const char *input_ptr)
 Sets the owner of the item. More...
 
const char * GetName ()
 Returns the name of the item.
 
const char * GetAlias ()
 Returns the alias of the item.
 
const char * GetShortDescription ()
 Returns the short description of the item.
 
const char * GetLongDescription ()
 Returns the long description of the item.
 
const char * GetUserDescription ()
 Returns the user description of the item.
 
const char * GetOwner ()
 Returns the owner of the item.
 
 NamedItem ()
 Default constructor of the class.
 
 NamedItem (NamedItem &input)
 Copy constructor of the class.
 
virtual ~NamedItem ()
 Class destructor. More...
 
void operator= (NamedItem &right_side)
 Provides the equal operator.
 
bool operator== (NamedItem &right_side)
 Provides the == operator.
 

Detailed Description

This class checks expected state violations.

If an expected state violation occurs, the parameter status is updated.

Constructor & Destructor Documentation

◆ ~ExpectedStateAlarm()

trek::ExpectedStateAlarm::~ExpectedStateAlarm ( )
virtual

Class destructor.

Removes all resources created with this instance of the class.

Member Function Documentation

◆ Check()

int32_t trek::ExpectedStateAlarm::Check ( const char *  input,
ParameterStatus status 
)

Checks the supplied string value for an expected state violation.

If a violation is detected, the parameter status is updated to reflect the violation. If no limit violations are found, the corresponding status is cleared.

Parameters
[in]inputThe value to check for violations
[out]statusThe parameter status associated with the Parameter
Returns
SUCCESS
TREK_DATA_NULL_PTR

◆ GetExpectedState()

const char * trek::ExpectedStateAlarm::GetExpectedState ( )

Gets the expected type for the alarm.

Returns
The expected state. A NULL pointer is returned if an expected state is not set.

◆ LoadFile()

int32_t trek::ExpectedStateAlarm::LoadFile ( const char *  filename)

Loads the ExpectedStateAlarm definition from the specified file.

Reads an XML format for the ExpectedStateAlarm. It can be written in with SaveFile.

Parameters
[in]filenameThe file to load the limit alarm object from.
Returns
SUCCESS
TREK_DATA_NULL_PTR
Other return codes

Example:

char *filename = "my_file.xml";
ret_value = esa.LoadFile( filename );
This class checks expected state violations.
Definition: expected_state_alarm.h:21
int32_t LoadFile(const char *filename)
Loads the ExpectedStateAlarm definition from the specified file.
Definition: expected_state_alarm.cpp:84

◆ SaveFile()

int32_t trek::ExpectedStateAlarm::SaveFile ( const char *  filename)

Saves the ExpectedStateAlarm definition to the specified file.

Writes an XML format for the ExpectedStateAlarm. It can be read in with LoadFile.

Parameters
[in]filenameThe file to save the limit alarm object to.
Returns
SUCCESS
TREK_DATA_NULL_PTR
Other return codes

Example:

char *filename = "my_file.xml";
ret_value = esa.SaveFile( filename );
int32_t SaveFile(const char *filename)
Saves the ExpectedStateAlarm definition to the specified file.
Definition: expected_state_alarm.cpp:119