F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TimeBaseEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimeBaseEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for TimeBase enum
5 // ======================================================================
6 
7 #ifndef TimeBaseEnumAc_HPP
8 #define TimeBaseEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Types/Assert.hpp"
13 #include "Fw/Types/String.hpp"
14 
16 class TimeBase :
17  public Fw::Serializable
18 {
19 
20  public:
21 
22  // ----------------------------------------------------------------------
23  // Types
24  // ----------------------------------------------------------------------
25 
27  using SerialType = U16;
28 
30  enum T {
32  TB_NONE = 0,
40  TB_DONT_CARE = 65535,
41  };
42 
44  using t = enum T;
45 
46  public:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
52  enum {
57  };
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Constructors
63  // ----------------------------------------------------------------------
64 
67  {
68  this->e = TB_NONE;
69  }
70 
73  const enum T e1
74  )
75  {
76  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
77  this->e = e1;
78  }
79 
82  const SerialType e1
83  )
84  {
85  FW_ASSERT(isValid(e1), static_cast<FwAssertArgType>(e1));
86  this->e = static_cast<enum T>(e1);
87  }
88 
91  const TimeBase& obj
92  )
93  {
94  this->e = obj.e;
95 #ifdef BUILD_UT
96  this->m_serializeValueIsSet = obj.m_serializeValueIsSet;
97  this->m_serializeValue = obj.m_serializeValue;
98 #endif
99  }
100 
101  public:
102 
103  // ----------------------------------------------------------------------
104  // Operators
105  // ----------------------------------------------------------------------
106 
109  const TimeBase& obj
110  );
111 
114  SerialType e1
115  );
116 
119  enum T e1
120  );
121 
123  operator enum T() const
124  {
125  return this->e;
126  }
127 
129  bool operator==(enum T e1) const
130  {
131  return this->e == e1;
132  }
133 
135  bool operator!=(enum T e1) const
136  {
137  return !(*this == e1);
138  }
139 
140 #ifdef BUILD_UT
141 
143  friend std::ostream& operator<<(
144  std::ostream& os,
145  const TimeBase& obj
146  );
147 
148 #endif
149 
150  public:
151 
152  // ----------------------------------------------------------------------
153  // Member functions
154  // ----------------------------------------------------------------------
155 
157  bool isValid() const;
158 
161  Fw::SerialBufferBase& buffer,
163  ) const;
164 
167  Fw::SerialBufferBase& buffer,
169  );
170 
171 #if FW_SERIALIZABLE_TO_STRING
172 
174  void toString(
175  Fw::StringBase& sb
176  ) const;
177 
178 #endif
179 
180 #ifdef BUILD_UT
181 
183  void setSerializeValue(
184  SerialType serializeValue
185  );
186 
187 #endif
188 
189  public:
190 
191  // ----------------------------------------------------------------------
192  // Static functions
193  // ----------------------------------------------------------------------
194 
196  static bool isValid(
197  SerialType serialTypeValue
198  );
199 
200  public:
201 
202  // ----------------------------------------------------------------------
203  // Public member variables
204  // ----------------------------------------------------------------------
205 
207  enum T e;
208 
209  private:
210 
211  // ----------------------------------------------------------------------
212  // Private member variables
213  // ----------------------------------------------------------------------
214 
215 #ifdef BUILD_UT
216 
222  bool m_serializeValueIsSet = false;
223 
225  SerialType m_serializeValue = 0;
226 
227 #endif
228 
229 };
230 
231 #endif
TimeBase(const enum T e1)
Constructor (user-provided value)
Don&#39;t care value for sequences. If FwTimeBaseStoreType is changed, value should be changed (Required)...
TimeBase(const TimeBase &obj)
Copy constructor.
No time base has been established (Required)
bool operator!=(enum T e1) const
Inequality operator.
bool operator==(enum T e1) const
Equality operator.
The number of enumerated constants.
T
The raw enum type.
bool isValid() const
Check raw enum value for validity.
enum T t
For backwards compatibility.
SerializeStatus
forward declaration for string
Time as reported on workstation where software is running. For testing. (Required) ...
TimeBase()
Constructor (default value of TB_NONE)
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialize raw enum value from SerialType.
TimeBase & operator=(const TimeBase &obj)
Copy assignment operator (object)
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialize raw enum value to SerialType.
TimeBase(const SerialType e1)
Constructor (serial representation value)
The size of the serial representation.
Indicates time is processor cycle time. Not tied to external time.
enum T e
The raw enum value.
Endianness
Time as reported by the spacecraft clock.
Define enumeration for Time base types.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Big endian serialization.
U16 SerialType
The serial representation type.