F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
LogSeverityEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LogSeverityEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for LogSeverity enum
5 // ======================================================================
6 
7 #ifndef Fw_LogSeverityEnumAc_HPP
8 #define Fw_LogSeverityEnumAc_HPP
9 
10 #include "FpConfig.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Fw {
15 
17  class LogSeverity :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  typedef I32 SerialType;
29 
31  enum T {
33  FATAL = 1,
39  COMMAND = 4,
46  };
47 
49  typedef T t;
50 
51  public:
52 
53  // ----------------------------------------------------------------------
54  // Constants
55  // ----------------------------------------------------------------------
56 
57  enum {
62  };
63 
64  public:
65 
66  // ----------------------------------------------------------------------
67  // Constructors
68  // ----------------------------------------------------------------------
69 
72  {
73  this->e = FATAL;
74  }
75 
78  const T e1
79  )
80  {
81  this->e = e1;
82  }
83 
86  const LogSeverity& obj
87  )
88  {
89  this->e = obj.e;
90  }
91 
92  public:
93 
94  // ----------------------------------------------------------------------
95  // Operators
96  // ----------------------------------------------------------------------
97 
100  const LogSeverity& obj
101  );
102 
105  T e1
106  );
107 
109  operator T() const
110  {
111  return this->e;
112  }
113 
115  bool operator==(T e1) const
116  {
117  return this->e == e1;
118  }
119 
121  bool operator!=(T e1) const
122  {
123  return !(*this == e1);
124  }
125 
126 #ifdef BUILD_UT
127 
129  friend std::ostream& operator<<(
130  std::ostream& os,
131  const LogSeverity& obj
132  );
133 
134 #endif
135 
136  public:
137 
138  // ----------------------------------------------------------------------
139  // Member functions
140  // ----------------------------------------------------------------------
141 
143  bool isValid() const;
144 
147  Fw::SerializeBufferBase& buffer
148  ) const;
149 
152  Fw::SerializeBufferBase& buffer
153  );
154 
155 #if FW_SERIALIZABLE_TO_STRING
156 
158  void toString(
159  Fw::StringBase& sb
160  ) const;
161 
162 #endif
163 
164  public:
165 
166  // ----------------------------------------------------------------------
167  // Member variables
168  // ----------------------------------------------------------------------
169 
171  T e;
172 
173  };
174 
175 }
176 
177 #endif
C++-compatible configuration header for fprime configuration.
Enum representing event severity.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
LogSeverity(const T e1)
Constructor (user-provided value)
LogSeverity(const LogSeverity &obj)
Copy constructor.
@ SERIALIZED_SIZE
The size of the serial representation.
@ NUM_CONSTANTS
The number of enumerated constants.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
bool operator==(T e1) const
Equality operator.
T e
The raw enum value.
bool operator!=(T e1) const
Inequality operator.
T t
For backwards compatibility.
bool isValid() const
Check raw enum value for validity.
LogSeverity()
Constructor (default value of FATAL)
I32 SerialType
The serial representation type.
T
The raw enum type.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
@ FATAL
A fatal non-recoverable event.
@ WARNING_LO
A less serious but recoverable event.
@ DIAGNOSTIC
Software diagnostic events.
@ ACTIVITY_LO
Less important informational events.
@ COMMAND
An activity related to commanding.
LogSeverity & operator=(const LogSeverity &obj)
Copy assignment operator (object)
forward declaration
SerializeStatus
forward declaration for string