CCSDSPack
C++ Library for CCSDS Space Packet manipulation. i.e. generation, extraction, analisys and more
|
#include <unordered_map>
#include <variant>
#include <vector>
#include <cstdint>
#include <iostream>
Go to the source code of this file.
Classes | |
class | CCSDS::Error |
Represents an error with both an error code and a message. More... | |
class | CCSDS::Result< T > |
Encapsulates a result that can hold either a value or an Error. More... | |
Namespaces | |
namespace | CCSDS |
Contains definitions and classes for handling CCSDS headers. | |
Macros | |
#define | RETURN_IF_ERROR(condition, errorCode) do { if (condition) return errorCode; } while (0) |
Macro to return an error code if a condition is met. | |
#define | RET_IF_ERR_MSG(condition, errorCode, message) |
Macro to return an error with an error message if a condition is met. | |
#define | ASSIGN_MV(var, result) |
Macro to assign a result value to a variable or return an error by moving. | |
#define | ASSIGN_CP(var, result) |
Macro to assign a result value to a variable or return an error by copy. | |
#define | ASSIGN_OR_PRINT(var, result) |
Macro to assign a result value or print an error message. | |
#define | ASSERT_SUCCESS(result) |
Macro to return immediately if the result contains an error (for void functions). | |
#define | FORWARD_RESULT(result) |
Macro to return a result as-is (for functions returning Result<T>). | |
Typedefs | |
using | CCSDS::ResultBool = Result< bool > |
using | CCSDS::ResultBuffer = Result< std::vector< uint8_t > > |
Enumerations | |
enum | CCSDS::ErrorCode : uint8_t { CCSDS::NONE = 0 , CCSDS::UNKNOWN_ERROR = 1 , CCSDS::NO_DATA = 2 , CCSDS::INVALID_DATA = 3 , CCSDS::INVALID_HEADER_DATA = 4 , CCSDS::INVALID_SECONDARY_HEADER_DATA = 5 , CCSDS::INVALID_APPLICATION_DATA = 6 , CCSDS::NULL_POINTER = 7 , CCSDS::INVALID_CHECKSUM = 8 , CCSDS::VALIDATION_FAILURE = 9 , CCSDS::SOMETHING_WENT_WRONG = 10 , CCSDS::FILE_READ_ERROR = 11 , CCSDS::FILE_WRITE_ERROR = 12 , CCSDS::CONFIG_FILE_ERROR = 13 } |
Defines various error codes used in CCSDS packet handling. More... | |
#define ASSERT_SUCCESS | ( | result | ) |
Macro to return immediately if the result contains an error (for void functions).
Definition at line 196 of file CCSDSResult.h.
#define ASSIGN_CP | ( | var, | |
result | |||
) |
Macro to assign a result value to a variable or return an error by copy.
Definition at line 170 of file CCSDSResult.h.
#define ASSIGN_MV | ( | var, | |
result | |||
) |
Macro to assign a result value to a variable or return an error by moving.
Definition at line 159 of file CCSDSResult.h.
#define ASSIGN_OR_PRINT | ( | var, | |
result | |||
) |
Macro to assign a result value or print an error message.
Definition at line 182 of file CCSDSResult.h.
#define FORWARD_RESULT | ( | result | ) |
Macro to return a result as-is (for functions returning Result<T>).
Definition at line 206 of file CCSDSResult.h.
#define RET_IF_ERR_MSG | ( | condition, | |
errorCode, | |||
message | |||
) |
Macro to return an error with an error message if a condition is met.
Definition at line 148 of file CCSDSResult.h.
#define RETURN_IF_ERROR | ( | condition, | |
errorCode | |||
) | do { if (condition) return errorCode; } while (0) |
Macro to return an error code if a condition is met.
Definition at line 141 of file CCSDSResult.h.