F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TCTrailerSerializableAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TCTrailerSerializableAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TCTrailer struct
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12  namespace Ccsds {
13 
14  // ----------------------------------------------------------------------
15  // Constructors
16  // ----------------------------------------------------------------------
17 
20  Serializable(),
21  m_fecf(0)
22  {
23 
24  }
25 
27  TCTrailer(U16 fecf) :
28  Serializable(),
29  m_fecf(fecf)
30  {
31 
32  }
33 
35  TCTrailer(const TCTrailer& obj) :
36  Serializable(),
37  m_fecf(obj.m_fecf)
38  {
39 
40  }
41 
42  // ----------------------------------------------------------------------
43  // Operators
44  // ----------------------------------------------------------------------
45 
47  operator=(const TCTrailer& obj)
48  {
49  if (this == &obj) {
50  return *this;
51  }
52 
53  set(obj.m_fecf);
54  return *this;
55  }
56 
57  bool TCTrailer ::
58  operator==(const TCTrailer& obj) const
59  {
60  return (this->m_fecf == obj.m_fecf);
61  }
62 
63  bool TCTrailer ::
64  operator!=(const TCTrailer& obj) const
65  {
66  return !(*this == obj);
67  }
68 
69 #ifdef BUILD_UT
70 
71  std::ostream& operator<<(std::ostream& os, const TCTrailer& obj) {
72  Fw::String s;
73  obj.toString(s);
74  os << s.toChar();
75  return os;
76  }
77 
78 #endif
79 
80  // ----------------------------------------------------------------------
81  // Member functions
82  // ----------------------------------------------------------------------
83 
86  {
87  Fw::SerializeStatus status;
88 
89  status = buffer.serializeFrom(this->m_fecf);
90  if (status != Fw::FW_SERIALIZE_OK) {
91  return status;
92  }
93 
94  return status;
95  }
96 
99  {
100  Fw::SerializeStatus status;
101 
102  status = buffer.deserializeTo(this->m_fecf);
103  if (status != Fw::FW_SERIALIZE_OK) {
104  return status;
105  }
106 
107  return status;
108  }
109 
112  {
113  FwSizeType size = 0;
114  size += sizeof(U16);
115  return size;
116  }
117 
118 #if FW_SERIALIZABLE_TO_STRING
119 
120  void TCTrailer ::
121  toString(Fw::StringBase& sb) const
122  {
123  Fw::String tmp;
124  sb = "( ";
125 
126  // Format fecf
127  sb += "fecf = ";
128  tmp.format("%" PRIu16 "", this->m_fecf);
129  sb += tmp;
130  sb += " )";
131  }
132 
133 #endif
134 
135  // ----------------------------------------------------------------------
136  // Setter functions
137  // ----------------------------------------------------------------------
138 
139  void TCTrailer ::
140  set(U16 fecf)
141  {
142  this->m_fecf = fecf;
143  }
144 
145  void TCTrailer ::
146  set_fecf(U16 fecf)
147  {
148  this->m_fecf = fecf;
149  }
150 
151  }
152 
153 }
Serialization/Deserialization operation was successful.
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
PlatformSizeType FwSizeType
const char * toChar() const
Definition: String.hpp:50
void set_fecf(U16 fecf)
Set member fecf.
bool operator==(const TCTrailer &obj) const
Equality operator.
SerializeStatus
forward declaration for string
Describes the frame trailer format for a Telecommand (TC) Transfer Frame.
Fw::SerializeStatus serializeTo(Fw::SerializeBufferBase &buffer) const
Serialization.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
TCTrailer & operator=(const TCTrailer &obj)
Copy assignment operator.
TCTrailer()
Constructor (default value)
RateGroupDivider component implementation.
SerializeStatus serializeFrom(U8 val)
serialize 8-bit unsigned int
void set(U16 fecf)
Set all members.
Fw::SerializeStatus deserializeFrom(Fw::SerializeBufferBase &buffer)
Deserialization.
bool operator!=(const TCTrailer &obj) const
Inequality operator.
SerializeStatus deserializeTo(U8 &val)
deserialize 8-bit unsigned int