F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FooterSerializableAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FooterSerializableAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for Footer struct
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12  namespace Fpy {
13 
14  // ----------------------------------------------------------------------
15  // Constructors
16  // ----------------------------------------------------------------------
17 
18  Footer ::
20  Serializable(),
21  m_crc(0)
22  {
23 
24  }
25 
26  Footer ::
27  Footer(U32 crc) :
28  Serializable(),
29  m_crc(crc)
30  {
31 
32  }
33 
34  Footer ::
35  Footer(const Footer& obj) :
36  Serializable(),
37  m_crc(obj.m_crc)
38  {
39 
40  }
41 
42  // ----------------------------------------------------------------------
43  // Operators
44  // ----------------------------------------------------------------------
45 
47  operator=(const Footer& obj)
48  {
49  if (this == &obj) {
50  return *this;
51  }
52 
53  set(obj.m_crc);
54  return *this;
55  }
56 
57  bool Footer ::
58  operator==(const Footer& obj) const
59  {
60  return (this->m_crc == obj.m_crc);
61  }
62 
63  bool Footer ::
64  operator!=(const Footer& obj) const
65  {
66  return !(*this == obj);
67  }
68 
69 #ifdef BUILD_UT
70 
71  std::ostream& operator<<(std::ostream& os, const Footer& 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_crc);
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_crc);
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(U32);
115  return size;
116  }
117 
118 #if FW_SERIALIZABLE_TO_STRING
119 
120  void Footer ::
121  toString(Fw::StringBase& sb) const
122  {
123  Fw::String tmp;
124  sb = "( ";
125 
126  // Format crc
127  sb += "crc = ";
128  tmp.format("%" PRIu32 "", this->m_crc);
129  sb += tmp;
130  sb += " )";
131  }
132 
133 #endif
134 
135  // ----------------------------------------------------------------------
136  // Setter functions
137  // ----------------------------------------------------------------------
138 
139  void Footer ::
140  set(U32 crc)
141  {
142  this->m_crc = crc;
143  }
144 
145  void Footer ::
146  set_crc(U32 crc)
147  {
148  this->m_crc = crc;
149  }
150 
151  }
152 
153 }
Serialization/Deserialization operation was successful.
PlatformSizeType FwSizeType
const char * toChar() const
Definition: String.hpp:50
SerializeStatus
forward declaration for string
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
RateGroupDivider component implementation.
SerializeStatus serializeFrom(U8 val)
serialize 8-bit unsigned int
SerializeStatus deserializeTo(U8 &val)
deserialize 8-bit unsigned int