F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FrameContextSerializableAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FrameContextSerializableAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FrameContext struct
5 // ======================================================================
6 
7 #ifndef ComCfg_FrameContextSerializableAc_HPP
8 #define ComCfg_FrameContextSerializableAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
13 #include "Fw/Types/String.hpp"
18 
19 namespace ComCfg {
20 
22  class FrameContext :
23  public Fw::Serializable
24  {
25 
26  public:
27 
28  // ----------------------------------------------------------------------
29  // Constants
30  // ----------------------------------------------------------------------
31 
32  enum {
35  sizeof(FwIndexType) +
38  sizeof(U8) +
39  sizeof(U8) +
40  sizeof(U16) +
41  sizeof(U8) +
43  sizeof(U8) +
44  sizeof(U16) +
45  sizeof(U16)
46  };
47 
48  public:
49 
50  // ----------------------------------------------------------------------
51  // Constructors
52  // ----------------------------------------------------------------------
53 
55  FrameContext();
56 
59  FwIndexType comQueueIndex,
60  ComCfg::Apid::T apid,
62  bool hasSecHdr,
63  U8 sequenceFlags,
64  U16 sequenceCount,
65  U8 vcId,
66  ComCfg::Pvn::T pvn,
67  bool sendNow,
68  U16 saIndex,
69  U16 firstHeaderPointer
70  );
71 
74  const FrameContext& obj
75  );
76 
77  public:
78 
79  // ----------------------------------------------------------------------
80  // Operators
81  // ----------------------------------------------------------------------
82 
85  const FrameContext& obj
86  );
87 
89  bool operator==(
90  const FrameContext& obj
91  ) const;
92 
94  bool operator!=(
95  const FrameContext& obj
96  ) const;
97 
98 #ifdef BUILD_UT
99 
101  friend std::ostream& operator<<(
102  std::ostream& os,
103  const FrameContext& obj
104  );
105 
106 #endif
107 
108  public:
109 
110  // ----------------------------------------------------------------------
111  // Member functions
112  // ----------------------------------------------------------------------
113 
116  Fw::SerialBufferBase& buffer,
118  ) const;
119 
122  Fw::SerialBufferBase& buffer,
124  );
125 
127  FwSizeType serializedSize() const;
128 
129 #if FW_SERIALIZABLE_TO_STRING
130 
132  void toString(
133  Fw::StringBase& sb
134  ) const;
135 
136 #endif
137 
138  // ----------------------------------------------------------------------
139  // Getter functions
140  // ----------------------------------------------------------------------
141 
144  {
145  return this->m_comQueueIndex;
146  }
147 
150  {
151  return this->m_apid.e;
152  }
153 
156  {
157  return this->m_pktType.e;
158  }
159 
161  bool get_hasSecHdr() const
162  {
163  return this->m_hasSecHdr;
164  }
165 
168  {
169  return this->m_sequenceFlags;
170  }
171 
173  U16 get_sequenceCount() const
174  {
175  return this->m_sequenceCount;
176  }
177 
179  U8 get_vcId() const
180  {
181  return this->m_vcId;
182  }
183 
186  {
187  return this->m_pvn.e;
188  }
189 
191  bool get_sendNow() const
192  {
193  return this->m_sendNow;
194  }
195 
197  U16 get_saIndex() const
198  {
199  return this->m_saIndex;
200  }
201 
204  {
205  return this->m_firstHeaderPointer;
206  }
207 
208  // ----------------------------------------------------------------------
209  // Setter functions
210  // ----------------------------------------------------------------------
211 
213  void set(
214  FwIndexType comQueueIndex,
215  ComCfg::Apid::T apid,
216  ComCfg::SppPacketType::T pktType,
217  bool hasSecHdr,
218  U8 sequenceFlags,
219  U16 sequenceCount,
220  U8 vcId,
221  ComCfg::Pvn::T pvn,
222  bool sendNow,
223  U16 saIndex,
224  U16 firstHeaderPointer
225  );
226 
228  void set_comQueueIndex(FwIndexType comQueueIndex);
229 
231  void set_apid(ComCfg::Apid::T apid);
232 
235 
237  void set_hasSecHdr(bool hasSecHdr);
238 
240  void set_sequenceFlags(U8 sequenceFlags);
241 
243  void set_sequenceCount(U16 sequenceCount);
244 
246  void set_vcId(U8 vcId);
247 
249  void set_pvn(ComCfg::Pvn::T pvn);
250 
252  void set_sendNow(bool sendNow);
253 
255  void set_saIndex(U16 saIndex);
256 
258  void set_firstHeaderPointer(U16 firstHeaderPointer);
259 
260  protected:
261 
262  // ----------------------------------------------------------------------
263  // Member variables
264  // ----------------------------------------------------------------------
265 
274  bool m_sendNow;
277 
278  };
279 
280 }
281 
282 #endif
Packet type in the Space Packet Primary Header.
ComCfg::SppPacketType::T get_pktType() const
Get member pktType.
FrameContext()
Constructor (default value)
PlatformSizeType FwSizeType
ComCfg::Apid::T get_apid() const
Get member apid.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialization.
void set_hasSecHdr(bool hasSecHdr)
Set member hasSecHdr.
T
The raw enum type.
Definition: PvnEnumAc.hpp:32
void set_apid(ComCfg::Apid::T apid)
Set member apid.
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
The size of the serial representation.
Definition: ApidEnumAc.hpp:70
void set_sendNow(bool sendNow)
Set member sendNow.
bool operator!=(const FrameContext &obj) const
Inequality operator.
The size of the serial representation.
FwIndexType get_comQueueIndex() const
Get member comQueueIndex.
SerializeStatus
forward declaration for string
ComCfg::Pvn::T get_pvn() const
Get member pvn.
void set_sequenceFlags(U8 sequenceFlags)
Set member sequenceFlags.
The size of the serial representation.
bool get_sendNow() const
Get member sendNow.
U16 get_sequenceCount() const
Get member sequenceCount.
T
The raw enum type.
Definition: ApidEnumAc.hpp:32
void set_sequenceCount(U16 sequenceCount)
Set member sequenceCount.
U8 get_vcId() const
Get member vcId.
void set_pvn(ComCfg::Pvn::T pvn)
Set member pvn.
U8 get_sequenceFlags() const
Get member sequenceFlags.
bool get_hasSecHdr() const
Get member hasSecHdr.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialization.
U16 get_firstHeaderPointer() const
Get member firstHeaderPointer.
Packet Version Numbers are 3 bits with only 2 currently valid values.
Definition: PvnEnumAc.hpp:18
void set_vcId(U8 vcId)
Set member vcId.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
bool operator==(const FrameContext &obj) const
Equality operator.
enum T e
The raw enum value.
Definition: ApidEnumAc.hpp:223
enum T e
The raw enum value.
Definition: PvnEnumAc.hpp:205
U16 get_saIndex() const
Get member saIndex.
void set_comQueueIndex(FwIndexType comQueueIndex)
Set member comQueueIndex.
void set_saIndex(U16 saIndex)
Set member saIndex.
PlatformIndexType FwIndexType
Type used to pass context info between components during framing/deframing.
The size of the serial representation.
Definition: PvnEnumAc.hpp:52
Endianness
void set_firstHeaderPointer(U16 firstHeaderPointer)
Set member firstHeaderPointer.
void set_pktType(ComCfg::SppPacketType::T pktType)
Set member pktType.
enum T e
The raw enum value.
APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF.
Definition: ApidEnumAc.hpp:18
Big endian serialization.
FrameContext & operator=(const FrameContext &obj)
Copy assignment operator.