CppSerdes  1.0
A serialization/deserialization library designed with embedded systems in mind
serdes_errors.h
Go to the documentation of this file.
1 #ifndef _SERDES_ERRORS_H_
8 #define _SERDES_ERRORS_H_
9 
11 namespace serdes
12 {
14  enum class status_e
15  {
17  NO_ERROR = 0,
18 
22 
26 
29  INVALID_FIELD = 3,
30 
34 
38 
42  };
43 
48  inline const char *status2str(status_e err_status) noexcept
49  {
50  switch (err_status)
51  {
52  case status_e::NO_ERROR:
53  return "NO_ERROR";
55  return "EXCEEDED_SERIAL_SIZE";
57  return "ARRAY_SIZE_OVER_MAX";
59  return "INVALID_FIELD";
61  return "NO_LOAD_TO_RVALUE";
63  return "DELIMITER_NOT_FOUND";
65  return "FORMATTER_NOT_SET";
66  default:
67  return "(null)";
68  }
69  }
70 
72  struct status_t
73  {
76 
78  size_t bits;
79  };
80 
82  enum class mode_e
83  {
85  LOADING,
86 
88  STORING,
89 
92  };
93 }
94 
95 #endif // _SERDES_ERRORS_H_
tried to loading data from a serial buffer into a temperary rvalue (causes the serdes process to abor...
not yet configured for storing/loading
size_t bits
number of bits processed
Definition: serdes_errors.h:78
a fields validation check failed (causes the serdes process to abort)
status_e
error status of serialization/deserialization process
Definition: serdes_errors.h:14
CppSerdes library namespace.
Definition: bitcpy_common.h:69
mode_e
the serdes mode of operation
Definition: serdes_errors.h:82
during serialization/deserialization the serial array boundary was reached (causes the serdes process...
the serdes::array object's size exceeded the maximum size of the array when evaluated (causes the ser...
status returned after any serialization/deserialization process
Definition: serdes_errors.h:72
a pure_virtual_formatter (a.k.a "serdes::formatter(nullptr)") was used but not overriden (causes the ...
(serializing) storing variables into serial data
the specified delimiter in a delimited_array object was not found before the end of the array (causes...
no serialization/deserialization errors occurred
status_e status
status of the serdes (load or store) action
Definition: serdes_errors.h:75
(deserializing) loading from serial data into variables
const char * status2str(status_e err_status) noexcept
converts an error status enum to a c style string
Definition: serdes_errors.h:48