F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ArgSpecSerializableAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ArgSpecSerializableAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for ArgSpec struct
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12  namespace Fpy {
13 
14  // ----------------------------------------------------------------------
15  // Constructors
16  // ----------------------------------------------------------------------
17 
20  Serializable(),
21  m_argName(m___fprime_ac_argName_buffer, sizeof m___fprime_ac_argName_buffer, Fw::String("")),
22  m_typeName(m___fprime_ac_typeName_buffer, sizeof m___fprime_ac_typeName_buffer, Fw::String("")),
23  m_argSize()
24  {
25 
26  }
27 
30  const Fw::StringBase& argName,
31  const Fw::StringBase& typeName,
33  ) :
34  Serializable(),
35  m_argName(m___fprime_ac_argName_buffer, sizeof m___fprime_ac_argName_buffer, argName),
36  m_typeName(m___fprime_ac_typeName_buffer, sizeof m___fprime_ac_typeName_buffer, typeName),
37  m_argSize(argSize)
38  {
39 
40  }
41 
43  ArgSpec(const ArgSpec& obj) :
44  Serializable(),
45  m_argName(m___fprime_ac_argName_buffer, sizeof m___fprime_ac_argName_buffer, obj.m_argName),
46  m_typeName(m___fprime_ac_typeName_buffer, sizeof m___fprime_ac_typeName_buffer, obj.m_typeName),
47  m_argSize(obj.m_argSize)
48  {
49 
50  }
51 
52  // ----------------------------------------------------------------------
53  // Operators
54  // ----------------------------------------------------------------------
55 
57  operator=(const ArgSpec& obj)
58  {
59  if (this == &obj) {
60  return *this;
61  }
62 
63  set(obj.m_argName, obj.m_typeName, obj.m_argSize);
64  return *this;
65  }
66 
67  bool ArgSpec ::
68  operator==(const ArgSpec& obj) const
69  {
70  if (this == &obj) { return true; }
71  return (
72  (this->m_argName == obj.m_argName) &&
73  (this->m_typeName == obj.m_typeName) &&
74  (this->m_argSize == obj.m_argSize)
75  );
76  }
77 
78  bool ArgSpec ::
79  operator!=(const ArgSpec& obj) const
80  {
81  return !(*this == obj);
82  }
83 
84 #ifdef BUILD_UT
85 
86  std::ostream& operator<<(std::ostream& os, const ArgSpec& obj) {
87  Fw::String s;
88  obj.toString(s);
89  os << s.toChar();
90  return os;
91  }
92 
93 #endif
94 
95  // ----------------------------------------------------------------------
96  // Member functions
97  // ----------------------------------------------------------------------
98 
101  Fw::SerialBufferBase& buffer,
102  Fw::Endianness mode
103  ) const
104  {
105  Fw::SerializeStatus status;
106 
107  status = buffer.serializeFrom(this->m_argName, mode);
108  if (status != Fw::FW_SERIALIZE_OK) {
109  return status;
110  }
111  status = buffer.serializeFrom(this->m_typeName, mode);
112  if (status != Fw::FW_SERIALIZE_OK) {
113  return status;
114  }
115  status = buffer.serializeFrom(this->m_argSize, mode);
116  if (status != Fw::FW_SERIALIZE_OK) {
117  return status;
118  }
119 
120  return status;
121  }
122 
125  Fw::SerialBufferBase& buffer,
126  Fw::Endianness mode
127  )
128  {
129  Fw::SerializeStatus status;
130 
131  status = buffer.deserializeTo(this->m_argName, mode);
132  if (status != Fw::FW_SERIALIZE_OK) {
133  return status;
134  }
135  status = buffer.deserializeTo(this->m_typeName, mode);
136  if (status != Fw::FW_SERIALIZE_OK) {
137  return status;
138  }
139  status = buffer.deserializeTo(this->m_argSize, mode);
140  if (status != Fw::FW_SERIALIZE_OK) {
141  return status;
142  }
143 
144  return status;
145  }
146 
149  {
150  FwSizeType size = 0;
151  size += this->m_argName.serializedSize();
152  size += this->m_typeName.serializedSize();
153  size += sizeof(Svc::Fpy::StackSizeType);
154  return size;
155  }
156 
157 #if FW_SERIALIZABLE_TO_STRING
158 
159  void ArgSpec ::
160  toString(Fw::StringBase& sb) const
161  {
162  Fw::String tmp;
163  sb = "( ";
164 
165  // Format argName
166  sb += "argName = ";
167  sb += this->m_argName;
168  sb += ", ";
169 
170  // Format typeName
171  sb += "typeName = ";
172  sb += this->m_typeName;
173  sb += ", ";
174 
175  // Format argSize
176  sb += "argSize = ";
177  tmp.format("%" PRIu32 "", this->m_argSize);
178  sb += tmp;
179  sb += " )";
180  }
181 
182 #endif
183 
184  // ----------------------------------------------------------------------
185  // Setter functions
186  // ----------------------------------------------------------------------
187 
188  void ArgSpec ::
190  const Fw::StringBase& argName,
191  const Fw::StringBase& typeName,
193  )
194  {
195  this->m_argName = argName;
196  this->m_typeName = typeName;
197  this->m_argSize = argSize;
198  }
199 
200  void ArgSpec ::
202  {
203  this->m_argName = argName;
204  }
205 
206  void ArgSpec ::
208  {
209  this->m_typeName = typeName;
210  }
211 
212  void ArgSpec ::
214  {
215  this->m_argSize = argSize;
216  }
217 
218  }
219 
220 }
Serialization/Deserialization operation was successful.
void set_argSize(Svc::Fpy::StackSizeType argSize)
Set member argSize.
bool operator!=(const ArgSpec &obj) const
Inequality operator.
PlatformSizeType FwSizeType
ArgSpec()
Constructor (default value)
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
Fw::ExternalString m_typeName
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
Svc::Fpy::StackSizeType m_argSize
virtual SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG)=0
Serialize an 8-bit unsigned integer value.
SerializeStatus
forward declaration for string
SizeType serializedSize() const
void set(const Fw::StringBase &argName, const Fw::StringBase &typeName, Svc::Fpy::StackSizeType argSize)
Set all members.
virtual SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG)=0
Deserialize an 8-bit unsigned integer value.
void set_argName(const Fw::StringBase &argName)
Set member argName.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialization.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
Fw::ExternalString m_argName
void set_typeName(const Fw::StringBase &typeName)
Set member typeName.
bool operator==(const ArgSpec &obj) const
Equality operator.
RateGroupDivider component implementation.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialization.
Implementation of malloc based allocator.
Endianness
ArgSpec & operator=(const ArgSpec &obj)
Copy assignment operator.
U32 StackSizeType
the type which everything referencing a size or offset on the stack is represented in ...