F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FrameContextSerializableAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FrameContextSerializableAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for FrameContext struct
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace ComCfg {
11 
12  // ----------------------------------------------------------------------
13  // Constructors
14  // ----------------------------------------------------------------------
15 
18  Serializable(),
19  m_comQueueIndex(0)
20  {
21 
22  }
23 
25  FrameContext(FwIndexType comQueueIndex) :
26  Serializable(),
27  m_comQueueIndex(comQueueIndex)
28  {
29 
30  }
31 
34  Serializable(),
35  m_comQueueIndex(obj.m_comQueueIndex)
36  {
37 
38  }
39 
40  // ----------------------------------------------------------------------
41  // Operators
42  // ----------------------------------------------------------------------
43 
46  {
47  if (this == &obj) {
48  return *this;
49  }
50 
51  set(obj.m_comQueueIndex);
52  return *this;
53  }
54 
55  bool FrameContext ::
56  operator==(const FrameContext& obj) const
57  {
58  return (this->m_comQueueIndex == obj.m_comQueueIndex);
59  }
60 
61  bool FrameContext ::
62  operator!=(const FrameContext& obj) const
63  {
64  return !(*this == obj);
65  }
66 
67 #ifdef BUILD_UT
68 
69  std::ostream& operator<<(std::ostream& os, const FrameContext& obj) {
70  Fw::String s;
71  obj.toString(s);
72  os << s.toChar();
73  return os;
74  }
75 
76 #endif
77 
78  // ----------------------------------------------------------------------
79  // Member functions
80  // ----------------------------------------------------------------------
81 
84  {
85  Fw::SerializeStatus status;
86 
87  status = buffer.serialize(this->m_comQueueIndex);
88  if (status != Fw::FW_SERIALIZE_OK) {
89  return status;
90  }
91 
92  return status;
93  }
94 
97  {
98  Fw::SerializeStatus status;
99 
100  status = buffer.deserialize(this->m_comQueueIndex);
101  if (status != Fw::FW_SERIALIZE_OK) {
102  return status;
103  }
104 
105  return status;
106  }
107 
108 #if FW_SERIALIZABLE_TO_STRING
109 
110  void FrameContext ::
111  toString(Fw::StringBase& sb) const
112  {
113  static const char* formatString =
114  "( "
115  "comQueueIndex = %s"
116  " )";
117 
118  sb.format(
119  formatString,
120  this->m_comQueueIndex
121  );
122  }
123 
124 #endif
125 
126  // ----------------------------------------------------------------------
127  // Setter functions
128  // ----------------------------------------------------------------------
129 
130  void FrameContext ::
131  set(FwIndexType comQueueIndex)
132  {
133  this->m_comQueueIndex = comQueueIndex;
134  }
135 
136  void FrameContext ::
138  {
139  this->m_comQueueIndex = comQueueIndex;
140  }
141 
142 }
Serialization/Deserialization operation was successful.
FrameContext()
Constructor (default value)
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
const char * toChar() const
Definition: String.hpp:50
bool operator!=(const FrameContext &obj) const
Inequality operator.
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialization.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialization.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
bool operator==(const FrameContext &obj) const
Equality operator.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
PlatformIndexType FwIndexType
Type used to pass context info between components during framing/deframing.
void setcomQueueIndex(FwIndexType comQueueIndex)
Set member comQueueIndex.
void set(FwIndexType comQueueIndex)
Set all members.
FrameContext & operator=(const FrameContext &obj)
Copy assignment operator.