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.serialize(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.deserialize(this->m_fecf);
103  if (status != Fw::FW_SERIALIZE_OK) {
104  return status;
105  }
106 
107  return status;
108  }
109 
110 #if FW_SERIALIZABLE_TO_STRING
111 
112  void TCTrailer ::
113  toString(Fw::StringBase& sb) const
114  {
115  static const char* formatString =
116  "( "
117  "fecf = %" PRIu16 ""
118  " )";
119 
120  sb.format(
121  formatString,
122  this->m_fecf
123  );
124  }
125 
126 #endif
127 
128  // ----------------------------------------------------------------------
129  // Setter functions
130  // ----------------------------------------------------------------------
131 
132  void TCTrailer ::
133  set(U16 fecf)
134  {
135  this->m_fecf = fecf;
136  }
137 
138  void TCTrailer ::
139  setfecf(U16 fecf)
140  {
141  this->m_fecf = fecf;
142  }
143 
144  }
145 
146 }
Serialization/Deserialization operation was successful.
void setfecf(U16 fecf)
Set member fecf.
bool operator!=(const TCTrailer &obj) const
Inequality operator.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialization.
const char * toChar() const
Definition: String.hpp:50
Describes the frame trailer format for a Telecommand (TC) Transfer Frame.
TCTrailer & operator=(const TCTrailer &obj)
Copy assignment operator.
bool operator==(const TCTrailer &obj) const
Equality operator.
SerializeStatus
forward declaration for string
TCTrailer()
Constructor (default value)
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialization.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void set(U16 fecf)
Set all members.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
RateGroupDivider component implementation.