F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
DpRecordSerializableAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpRecordSerializableAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DpRecord struct
5 // ======================================================================
6 
7 #ifndef Svc_DpRecordSerializableAc_HPP
8 #define Svc_DpRecordSerializableAc_HPP
9 
10 #include "FpConfig.hpp"
11 #include "Fw/Dp/DpStateEnumAc.hpp"
14 #include "Fw/Types/String.hpp"
15 
16 namespace Svc {
17 
19  class DpRecord :
20  public Fw::Serializable
21  {
22 
23  public:
24 
25  // ----------------------------------------------------------------------
26  // Constants
27  // ----------------------------------------------------------------------
28 
29  enum {
32  sizeof(U32) +
33  sizeof(U32) +
34  sizeof(U32) +
35  sizeof(U32) +
36  sizeof(U64) +
38  };
39 
40  public:
41 
42  // ----------------------------------------------------------------------
43  // Constructors
44  // ----------------------------------------------------------------------
45 
47  DpRecord();
48 
50  DpRecord(
51  U32 id,
52  U32 tSec,
53  U32 tSub,
54  U32 priority,
55  U64 size,
56  Fw::DpState::T state
57  );
58 
60  DpRecord(
61  const DpRecord& obj
62  );
63 
64  public:
65 
66  // ----------------------------------------------------------------------
67  // Operators
68  // ----------------------------------------------------------------------
69 
72  const DpRecord& obj
73  );
74 
76  bool operator==(
77  const DpRecord& obj
78  ) const;
79 
81  bool operator!=(
82  const DpRecord& obj
83  ) const;
84 
85 #ifdef BUILD_UT
86 
88  friend std::ostream& operator<<(
89  std::ostream& os,
90  const DpRecord& obj
91  );
92 
93 #endif
94 
95  public:
96 
97  // ----------------------------------------------------------------------
98  // Member functions
99  // ----------------------------------------------------------------------
100 
103  Fw::SerializeBufferBase& buffer
104  ) const;
105 
108  Fw::SerializeBufferBase& buffer
109  );
110 
111 #if FW_SERIALIZABLE_TO_STRING
112 
114  void toString(
115  Fw::StringBase& sb
116  ) const;
117 
118 #endif
119 
120  // ----------------------------------------------------------------------
121  // Getter functions
122  // ----------------------------------------------------------------------
123 
125  U32 getid() const
126  {
127  return this->m_id;
128  }
129 
131  U32 gettSec() const
132  {
133  return this->m_tSec;
134  }
135 
137  U32 gettSub() const
138  {
139  return this->m_tSub;
140  }
141 
143  U32 getpriority() const
144  {
145  return this->m_priority;
146  }
147 
149  U64 getsize() const
150  {
151  return this->m_size;
152  }
153 
156  {
157  return this->m_state.e;
158  }
159 
160  // ----------------------------------------------------------------------
161  // Setter functions
162  // ----------------------------------------------------------------------
163 
165  void set(
166  U32 id,
167  U32 tSec,
168  U32 tSub,
169  U32 priority,
170  U64 size,
171  Fw::DpState::T state
172  );
173 
175  void setid(U32 id);
176 
178  void settSec(U32 tSec);
179 
181  void settSub(U32 tSub);
182 
184  void setpriority(U32 priority);
185 
187  void setsize(U64 size);
188 
190  void setstate(Fw::DpState::T state);
191 
192  protected:
193 
194  // ----------------------------------------------------------------------
195  // Member variables
196  // ----------------------------------------------------------------------
197 
198  U32 m_id;
199  U32 m_tSec;
200  U32 m_tSub;
204 
205  };
206 
207 }
208 
209 #endif
C++-compatible configuration header for fprime configuration.
T
The raw enum type.
T e
The raw enum value.
@ SERIALIZED_SIZE
The size of the serial representation.
forward declaration
Data structure representing a data product.
DpRecord()
Constructor (default value)
void set(U32 id, U32 tSec, U32 tSub, U32 priority, U64 size, Fw::DpState::T state)
Set all members.
@ SERIALIZED_SIZE
The size of the serial representation.
U64 getsize() const
Get member size.
U32 getid() const
Get member id.
void setstate(Fw::DpState::T state)
Set member state.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialization.
Fw::DpState::T getstate() const
Get member state.
void setpriority(U32 priority)
Set member priority.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialization.
void setid(U32 id)
Set member id.
void setsize(U64 size)
Set member size.
DpRecord & operator=(const DpRecord &obj)
Copy assignment operator.
U32 getpriority() const
Get member priority.
U32 gettSec() const
Get member tSec.
void settSec(U32 tSec)
Set member tSec.
U32 gettSub() const
Get member tSub.
bool operator==(const DpRecord &obj) const
Equality operator.
bool operator!=(const DpRecord &obj) const
Inequality operator.
void settSub(U32 tSub)
Set member tSub.
SerializeStatus
forward declaration for string
#define U64(C)
Definition: sha.h:176