F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ApidEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ApidEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Apid enum
5 // ======================================================================
6 
7 #ifndef ComCfg_ApidEnumAc_HPP
8 #define ComCfg_ApidEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace ComCfg {
15 
17  class Apid :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  typedef U16 SerialType;
29 
31  enum T {
54  };
55 
57  typedef T t;
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Constants
63  // ----------------------------------------------------------------------
64 
65  enum {
70  };
71 
72  public:
73 
74  // ----------------------------------------------------------------------
75  // Constructors
76  // ----------------------------------------------------------------------
77 
79  Apid()
80  {
81  this->e = INVALID_UNINITIALIZED;
82  }
83 
86  const T e1
87  )
88  {
89  this->e = e1;
90  }
91 
94  const Apid& obj
95  )
96  {
97  this->e = obj.e;
98  }
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Operators
104  // ----------------------------------------------------------------------
105 
107  Apid& operator=(
108  const Apid& obj
109  );
110 
112  Apid& operator=(
113  T e1
114  );
115 
117  operator T() const
118  {
119  return this->e;
120  }
121 
123  bool operator==(T e1) const
124  {
125  return this->e == e1;
126  }
127 
129  bool operator!=(T e1) const
130  {
131  return !(*this == e1);
132  }
133 
134 #ifdef BUILD_UT
135 
137  friend std::ostream& operator<<(
138  std::ostream& os,
139  const Apid& obj
140  );
141 
142 #endif
143 
144  public:
145 
146  // ----------------------------------------------------------------------
147  // Member functions
148  // ----------------------------------------------------------------------
149 
151  bool isValid() const;
152 
155  Fw::SerializeBufferBase& buffer
156  ) const;
157 
160  Fw::SerializeBufferBase& buffer
161  );
162 
163 #if FW_SERIALIZABLE_TO_STRING
164 
166  void toString(
167  Fw::StringBase& sb
168  ) const;
169 
170 #endif
171 
172  public:
173 
174  // ----------------------------------------------------------------------
175  // Member variables
176  // ----------------------------------------------------------------------
177 
179  T e;
180 
181  };
182 
183 }
184 
185 #endif
Packetized telemetry packet type.
Definition: ApidEnumAc.hpp:41
The number of enumerated constants.
Definition: ApidEnumAc.hpp:69
Apid()
Constructor (default value of INVALID_UNINITIALIZED)
Definition: ApidEnumAc.hpp:79
Apid(const T e1)
Constructor (user-provided value)
Definition: ApidEnumAc.hpp:85
Apid(const Apid &obj)
Copy constructor.
Definition: ApidEnumAc.hpp:93
SerializeStatus
forward declaration for string
The size of the serial representation.
Definition: ApidEnumAc.hpp:67
F Prime handshake.
Definition: ApidEnumAc.hpp:47
T
The raw enum type.
Definition: ApidEnumAc.hpp:31
Telemetry packet type - outgoing.
Definition: ApidEnumAc.hpp:35
U16 SerialType
The serial representation type.
Definition: ApidEnumAc.hpp:28
Fw::SerializeStatus deserializeFrom(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
Definition: ApidEnumAc.cpp:66
Apid & operator=(const Apid &obj)
Copy assignment operator (object)
Definition: ApidEnumAc.cpp:20
F Prime unknown packet.
Definition: ApidEnumAc.hpp:49
Data Product packet type.
Definition: ApidEnumAc.hpp:43
Anything equal or higher value is invalid and should not be used.
Definition: ApidEnumAc.hpp:53
bool operator==(T e1) const
Equality operator.
Definition: ApidEnumAc.hpp:123
Fw::SerializeStatus serializeTo(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
Definition: ApidEnumAc.cpp:57
T t
For backwards compatibility.
Definition: ApidEnumAc.hpp:57
T e
The raw enum value.
Definition: ApidEnumAc.hpp:179
forward declaration
bool isValid() const
Check raw enum value for validity.
Definition: ApidEnumAc.cpp:49
Per Space Packet Standard, all 1s (11bits) is reserved for Idle Packets.
Definition: ApidEnumAc.hpp:51
File type - incoming and outgoing.
Definition: ApidEnumAc.hpp:39
bool operator!=(T e1) const
Inequality operator.
Definition: ApidEnumAc.hpp:129
APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF.
Definition: ApidEnumAc.hpp:17
Log type - outgoing.
Definition: ApidEnumAc.hpp:37
Command packet type - incoming.
Definition: ApidEnumAc.hpp:33