F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TimeValueSerializableAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimeValueSerializableAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for TimeValue struct
5 // ======================================================================
6 
7 #ifndef Fw_TimeValueSerializableAc_HPP
8 #define Fw_TimeValueSerializableAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
13 #include "Fw/Types/String.hpp"
16 
17 namespace Fw {
18 
20  class TimeValue :
21  public Fw::Serializable
22  {
23 
24  public:
25 
26  // ----------------------------------------------------------------------
27  // Constants
28  // ----------------------------------------------------------------------
29 
30  enum {
34  sizeof(FwTimeContextStoreType) +
35  sizeof(U32) +
36  sizeof(U32)
37  };
38 
39  public:
40 
41  // ----------------------------------------------------------------------
42  // Constructors
43  // ----------------------------------------------------------------------
44 
46  TimeValue();
47 
49  TimeValue(
50  TimeBase::T timeBase,
51  FwTimeContextStoreType timeContext,
52  U32 seconds,
53  U32 useconds
54  );
55 
57  TimeValue(
58  const TimeValue& obj
59  );
60 
61  public:
62 
63  // ----------------------------------------------------------------------
64  // Operators
65  // ----------------------------------------------------------------------
66 
69  const TimeValue& obj
70  );
71 
73  bool operator==(
74  const TimeValue& obj
75  ) const;
76 
78  bool operator!=(
79  const TimeValue& obj
80  ) const;
81 
82 #ifdef BUILD_UT
83 
85  friend std::ostream& operator<<(
86  std::ostream& os,
87  const TimeValue& obj
88  );
89 
90 #endif
91 
92  public:
93 
94  // ----------------------------------------------------------------------
95  // Member functions
96  // ----------------------------------------------------------------------
97 
100  Fw::SerialBufferBase& buffer,
102  ) const;
103 
106  Fw::SerialBufferBase& buffer,
108  );
109 
111  FwSizeType serializedSize() const;
112 
113 #if FW_SERIALIZABLE_TO_STRING
114 
116  void toString(
117  Fw::StringBase& sb
118  ) const;
119 
120 #endif
121 
122  // ----------------------------------------------------------------------
123  // Getter functions
124  // ----------------------------------------------------------------------
125 
128  {
129  return this->m_timeBase.e;
130  }
131 
134  {
135  return this->m_timeContext;
136  }
137 
139  U32 get_seconds() const
140  {
141  return this->m_seconds;
142  }
143 
145  U32 get_useconds() const
146  {
147  return this->m_useconds;
148  }
149 
150  // ----------------------------------------------------------------------
151  // Setter functions
152  // ----------------------------------------------------------------------
153 
155  void set(
156  TimeBase::T timeBase,
157  FwTimeContextStoreType timeContext,
158  U32 seconds,
159  U32 useconds
160  );
161 
163  void set_timeBase(TimeBase::T timeBase);
164 
166  void set_timeContext(FwTimeContextStoreType timeContext);
167 
169  void set_seconds(U32 seconds);
170 
172  void set_useconds(U32 useconds);
173 
174  protected:
175 
176  // ----------------------------------------------------------------------
177  // Member variables
178  // ----------------------------------------------------------------------
179 
184 
185  };
186 
187 }
188 
189 #endif
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
U32 get_useconds() const
Get member useconds.
FwTimeContextStoreType get_timeContext() const
Get member timeContext.
PlatformSizeType FwSizeType
bool operator==(const TimeValue &obj) const
Equality operator.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialization.
The size of the serial representation.
TimeBase::T get_timeBase() const
Get member timeBase.
U8 FwTimeContextStoreType
The type used to serialize a time context value.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialization.
T
The raw enum type.
T e
The raw enum value.
SerializeStatus
forward declaration for string
void set_seconds(U32 seconds)
Set member seconds.
TimeValue & operator=(const TimeValue &obj)
Copy assignment operator.
TimeValue()
Constructor (default value)
FwTimeContextStoreType m_timeContext
bool operator!=(const TimeValue &obj) const
Inequality operator.
The size of the serial representation.
Data structure for Time.
void set_timeBase(TimeBase::T timeBase)
Set member timeBase.
void set_timeContext(FwTimeContextStoreType timeContext)
Set member timeContext.
U32 get_seconds() const
Get member seconds.
Implementation of malloc based allocator.
Endianness
Define enumeration for Time base types.
Big endian serialization.
void set_useconds(U32 useconds)
Set member useconds.