CCSDSPack
C++ Library for CCSDS Space Packet manipulation. i.e. generation, extraction, analisys and more
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CCSDS::Error Class Reference

Represents an error with both an error code and a message. More...

#include <CCSDSResult.h>

Public Member Functions

 Error (const ErrorCode code, std::string message)
 Constructs an error with a given error code and message.
 
ErrorCode code () const
 Retrieves the error code.
 
const std::string & message () const
 Retrieves the error message.
 

Private Attributes

ErrorCode m_code
 The error type.
 
std::string m_message
 A detailed message describing the error.
 

Detailed Description

Represents an error with both an error code and a message.

This class is used to provide additional error context by combining an ErrorCode with a detailed message, allowing differentiation between multiple errors of the same type.

Definition at line 43 of file CCSDSResult.h.

Constructor & Destructor Documentation

◆ Error()

CCSDS::Error::Error ( const ErrorCode  code,
std::string  message 
)
inline

Constructs an error with a given error code and message.

Parameters
codeThe error code representing the type of error.
messageA detailed description of the error.

Definition at line 50 of file CCSDSResult.h.

51 : m_code(code), m_message(std::move(message)) {
52 }
ErrorCode code() const
Retrieves the error code.
Definition CCSDSResult.h:58
ErrorCode m_code
The error type.
Definition CCSDSResult.h:67
const std::string & message() const
Retrieves the error message.
Definition CCSDSResult.h:64
std::string m_message
A detailed message describing the error.
Definition CCSDSResult.h:68

Member Function Documentation

◆ code()

ErrorCode CCSDS::Error::code ( ) const
inline

Retrieves the error code.

Returns
The associated ErrorCode.

Definition at line 58 of file CCSDSResult.h.

58{ return m_code; }

◆ message()

const std::string & CCSDS::Error::message ( ) const
inline

Retrieves the error message.

Returns
The detailed error description.

Definition at line 64 of file CCSDSResult.h.

64{ return m_message; }

Member Data Documentation

◆ m_code

ErrorCode CCSDS::Error::m_code
private

The error type.

Definition at line 67 of file CCSDSResult.h.

◆ m_message

std::string CCSDS::Error::m_message
private

A detailed message describing the error.

Definition at line 68 of file CCSDSResult.h.


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