F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
DirectionEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DirectionEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Direction enum
5 // ======================================================================
6 
7 #ifndef Fw_DirectionEnumAc_HPP
8 #define Fw_DirectionEnumAc_HPP
9 
10 #include "FpConfig.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Fw {
15 
17  class Direction :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  typedef I32 SerialType;
29 
31  enum T {
33  IN = 0,
35  OUT = 1,
37  INOUT = 2,
38  };
39 
41  typedef T t;
42 
43  public:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
49  enum {
54  };
55 
56  public:
57 
58  // ----------------------------------------------------------------------
59  // Constructors
60  // ----------------------------------------------------------------------
61 
64  {
65  this->e = IN;
66  }
67 
70  const T e1
71  )
72  {
73  this->e = e1;
74  }
75 
78  const Direction& obj
79  )
80  {
81  this->e = obj.e;
82  }
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Operators
88  // ----------------------------------------------------------------------
89 
92  const Direction& obj
93  );
94 
97  T e1
98  );
99 
101  operator T() const
102  {
103  return this->e;
104  }
105 
107  bool operator==(T e1) const
108  {
109  return this->e == e1;
110  }
111 
113  bool operator!=(T e1) const
114  {
115  return !(*this == e1);
116  }
117 
118 #ifdef BUILD_UT
119 
121  friend std::ostream& operator<<(
122  std::ostream& os,
123  const Direction& obj
124  );
125 
126 #endif
127 
128  public:
129 
130  // ----------------------------------------------------------------------
131  // Member functions
132  // ----------------------------------------------------------------------
133 
135  bool isValid() const;
136 
139  Fw::SerializeBufferBase& buffer
140  ) const;
141 
144  Fw::SerializeBufferBase& buffer
145  );
146 
147 #if FW_SERIALIZABLE_TO_STRING
148 
150  void toString(
151  Fw::StringBase& sb
152  ) const;
153 
154 #endif
155 
156  public:
157 
158  // ----------------------------------------------------------------------
159  // Member variables
160  // ----------------------------------------------------------------------
161 
163  T e;
164 
165  };
166 
167 }
168 
169 #endif
C++-compatible configuration header for fprime configuration.
Direction states.
Direction & operator=(const Direction &obj)
Copy assignment operator (object)
bool operator==(T e1) const
Equality operator.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
I32 SerialType
The serial representation type.
Direction()
Constructor (default value of IN)
Direction(const Direction &obj)
Copy constructor.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
@ NUM_CONSTANTS
The number of enumerated constants.
@ SERIALIZED_SIZE
The size of the serial representation.
bool isValid() const
Check raw enum value for validity.
Direction(const T e1)
Constructor (user-provided value)
bool operator!=(T e1) const
Inequality operator.
T t
For backwards compatibility.
T e
The raw enum value.
T
The raw enum type.
@ IN
In direction.
@ OUT
Out direction.
@ INOUT
In/Out direction.
forward declaration
SerializeStatus
forward declaration for string