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::SerializeBufferBase& buffer
101  ) const;
102 
105  Fw::SerializeBufferBase& 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_timeBase.e;
128  }
129 
132  {
133  return this->m_timeContext;
134  }
135 
137  U32 get_seconds() const
138  {
139  return this->m_seconds;
140  }
141 
143  U32 get_useconds() const
144  {
145  return this->m_useconds;
146  }
147 
148  // ----------------------------------------------------------------------
149  // Setter functions
150  // ----------------------------------------------------------------------
151 
153  void set(
154  TimeBase::T timeBase,
155  FwTimeContextStoreType timeContext,
156  U32 seconds,
157  U32 useconds
158  );
159 
161  void set_timeBase(TimeBase::T timeBase);
162 
164  void set_timeContext(FwTimeContextStoreType timeContext);
165 
167  void set_seconds(U32 seconds);
168 
170  void set_useconds(U32 useconds);
171 
172  protected:
173 
174  // ----------------------------------------------------------------------
175  // Member variables
176  // ----------------------------------------------------------------------
177 
182 
183  };
184 
185 }
186 
187 #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.
TimeBase::T get_timeBase() const
Get member timeBase.
U8 FwTimeContextStoreType
The type used to serialize a time context value.
T
The raw enum type.
T e
The raw enum value.
SerializeStatus
forward declaration for string
void set_seconds(U32 seconds)
Set member seconds.
Fw::SerializeStatus deserializeFrom(Fw::SerializeBufferBase &buffer)
Deserialization.
Fw::SerializeStatus serializeTo(Fw::SerializeBufferBase &buffer) const
Serialization.
TimeValue & operator=(const TimeValue &obj)
Copy assignment operator.
The size of the serial representation.
TimeValue()
Constructor (default value)
FwTimeContextStoreType m_timeContext
bool operator!=(const TimeValue &obj) const
Inequality operator.
Data structure for Time.
void set_timeBase(TimeBase::T timeBase)
Set member timeBase.
void set_timeContext(FwTimeContextStoreType timeContext)
Set member timeContext.
forward declaration
U32 get_seconds() const
Get member seconds.
Define enumeration for Time base types.
The size of the serial representation.
void set_useconds(U32 useconds)
Set member useconds.