F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TimeBasePairSerializableAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimeBasePairSerializableAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TimeBasePair struct
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12  // ----------------------------------------------------------------------
13  // Constructors
14  // ----------------------------------------------------------------------
15 
18  Serializable(),
19  m_lower(),
20  m_upper()
21  {
22 
23  }
24 
27  TimeBase::T lower,
28  TimeBase::T upper
29  ) :
30  Serializable(),
31  m_lower(lower),
32  m_upper(upper)
33  {
34 
35  }
36 
39  Serializable(),
40  m_lower(obj.m_lower),
41  m_upper(obj.m_upper)
42  {
43 
44  }
45 
46  // ----------------------------------------------------------------------
47  // Operators
48  // ----------------------------------------------------------------------
49 
52  {
53  if (this == &obj) {
54  return *this;
55  }
56 
57  set(obj.m_lower, obj.m_upper);
58  return *this;
59  }
60 
61  bool TimeBasePair ::
62  operator==(const TimeBasePair& obj) const
63  {
64  if (this == &obj) { return true; }
65  return (
66  (this->m_lower == obj.m_lower) &&
67  (this->m_upper == obj.m_upper)
68  );
69  }
70 
71  bool TimeBasePair ::
72  operator!=(const TimeBasePair& obj) const
73  {
74  return !(*this == obj);
75  }
76 
77 #ifdef BUILD_UT
78 
79  std::ostream& operator<<(std::ostream& os, const TimeBasePair& obj) {
80  Fw::String s;
81  obj.toString(s);
82  os << s.toChar();
83  return os;
84  }
85 
86 #endif
87 
88  // ----------------------------------------------------------------------
89  // Member functions
90  // ----------------------------------------------------------------------
91 
94  Fw::SerialBufferBase& buffer,
95  Fw::Endianness mode
96  ) const
97  {
98  Fw::SerializeStatus status;
99 
100  status = buffer.serializeFrom(this->m_lower, mode);
101  if (status != Fw::FW_SERIALIZE_OK) {
102  return status;
103  }
104  status = buffer.serializeFrom(this->m_upper, mode);
105  if (status != Fw::FW_SERIALIZE_OK) {
106  return status;
107  }
108 
109  return status;
110  }
111 
114  Fw::SerialBufferBase& buffer,
115  Fw::Endianness mode
116  )
117  {
118  Fw::SerializeStatus status;
119 
120  status = buffer.deserializeTo(this->m_lower, mode);
121  if (status != Fw::FW_SERIALIZE_OK) {
122  return status;
123  }
124  status = buffer.deserializeTo(this->m_upper, mode);
125  if (status != Fw::FW_SERIALIZE_OK) {
126  return status;
127  }
128 
129  return status;
130  }
131 
134  {
135  FwSizeType size = 0;
138  return size;
139  }
140 
141 #if FW_SERIALIZABLE_TO_STRING
142 
143  void TimeBasePair ::
144  toString(Fw::StringBase& sb) const
145  {
146  Fw::String tmp;
147  sb = "( ";
148 
149  // Format lower
150  sb += "lower = ";
151  this->m_lower.toString(tmp);
152  sb += tmp;
153  sb += ", ";
154 
155  // Format upper
156  sb += "upper = ";
157  this->m_upper.toString(tmp);
158  sb += tmp;
159  sb += " )";
160  }
161 
162 #endif
163 
164  // ----------------------------------------------------------------------
165  // Setter functions
166  // ----------------------------------------------------------------------
167 
168  void TimeBasePair ::
170  TimeBase::T lower,
171  TimeBase::T upper
172  )
173  {
174  this->m_lower = lower;
175  this->m_upper = upper;
176  }
177 
178  void TimeBasePair ::
180  {
181  this->m_lower = lower;
182  }
183 
184  void TimeBasePair ::
186  {
187  this->m_upper = upper;
188  }
189 
190 }
Serialization/Deserialization operation was successful.
TimeBasePair & operator=(const TimeBasePair &obj)
Copy assignment operator.
void set_lower(TimeBase::T lower)
Set member lower.
PlatformSizeType FwSizeType
TimeBasePair()
Constructor (default value)
bool operator!=(const TimeBasePair &obj) const
Inequality operator.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialization.
virtual SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG)=0
Serialize an 8-bit unsigned integer value.
T
The raw enum type.
bool operator==(const TimeBasePair &obj) const
Equality operator.
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
SerializeStatus
forward declaration for string
virtual SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG)=0
Deserialize an 8-bit unsigned integer value.
const char * toChar() const
Convert to a C-style char*.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialization.
void set(TimeBase::T lower, TimeBase::T upper)
Set all members.
The size of the serial representation.
RateGroupDivider component implementation.
void set_upper(TimeBase::T upper)
Set member upper.
Endianness