F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TimeOffsetSerializableAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimeOffsetSerializableAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for TimeOffset struct
5 // ======================================================================
6 
7 #ifndef Svc_TimeOffsetSerializableAc_HPP
8 #define Svc_TimeOffsetSerializableAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
13 #include "Fw/Types/String.hpp"
15 
16 namespace Svc {
17 
20  class TimeOffset :
21  public Fw::Serializable
22  {
23 
24  public:
25 
26  // ----------------------------------------------------------------------
27  // Constants
28  // ----------------------------------------------------------------------
29 
30  enum {
35  sizeof(I64)
36  };
37 
38  public:
39 
40  // ----------------------------------------------------------------------
41  // Constructors
42  // ----------------------------------------------------------------------
43 
45  TimeOffset();
46 
48  TimeOffset(
49  TimeBase::T from,
50  TimeBase::T to,
51  I64 offset_us
52  );
53 
55  TimeOffset(
56  const TimeOffset& obj
57  );
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Operators
63  // ----------------------------------------------------------------------
64 
67  const TimeOffset& obj
68  );
69 
71  bool operator==(
72  const TimeOffset& obj
73  ) const;
74 
76  bool operator!=(
77  const TimeOffset& obj
78  ) const;
79 
80 #ifdef BUILD_UT
81 
83  friend std::ostream& operator<<(
84  std::ostream& os,
85  const TimeOffset& obj
86  );
87 
88 #endif
89 
90  public:
91 
92  // ----------------------------------------------------------------------
93  // Member functions
94  // ----------------------------------------------------------------------
95 
98  Fw::SerialBufferBase& buffer,
100  ) const;
101 
104  Fw::SerialBufferBase& buffer,
106  );
107 
109  FwSizeType serializedSize() const;
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 
126  {
127  return this->m_from.e;
128  }
129 
132  {
133  return this->m_to.e;
134  }
135 
137  I64 get_offset_us() const
138  {
139  return this->m_offset_us;
140  }
141 
142  // ----------------------------------------------------------------------
143  // Setter functions
144  // ----------------------------------------------------------------------
145 
147  void set(
148  TimeBase::T from,
149  TimeBase::T to,
150  I64 offset_us
151  );
152 
154  void set_from(TimeBase::T from);
155 
157  void set_to(TimeBase::T to);
158 
160  void set_offset_us(I64 offset_us);
161 
162  protected:
163 
164  // ----------------------------------------------------------------------
165  // Member variables
166  // ----------------------------------------------------------------------
167 
171 
172  };
173 
174 }
175 
176 #endif
TimeOffset & operator=(const TimeOffset &obj)
Copy assignment operator.
TimeBase::T get_to() const
Get member to.
PlatformSizeType FwSizeType
bool operator==(const TimeOffset &obj) const
Equality operator.
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
I64 get_offset_us() const
Get member offset_us.
T
The raw enum type.
SerializeStatus
forward declaration for string
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialization.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialization.
void set_from(TimeBase::T from)
Set member from.
TimeBase::T get_from() const
Get member from.
TimeOffset()
Constructor (default value)
bool operator!=(const TimeOffset &obj) const
Inequality operator.
void set_offset_us(I64 offset_us)
Set member offset_us.
void set_to(TimeBase::T to)
Set member to.
The size of the serial representation.
RateGroupDivider component implementation.
The size of the serial representation.
enum T e
The raw enum value.
Endianness
Define enumeration for Time base types.
Big endian serialization.