F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
PolyPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PolyPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Poly port
5 // ======================================================================
6 
7 #ifndef Svc_PolyPortAc_HPP
8 #define Svc_PolyPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
13 #include "FpConfig.hpp"
17 #include "Fw/Time/Time.hpp"
18 #include "Fw/Types/PolyType.hpp"
20 #include "Fw/Types/StringType.hpp"
22 
23 namespace Svc {
24 
27  class InputPolyPort :
28  public Fw::InputPortBase
29  {
30 
31  public:
32 
33  // ----------------------------------------------------------------------
34  // Constants
35  // ----------------------------------------------------------------------
36 
37  enum {
40  sizeof(U32) +
44  };
45 
46  public:
47 
48  // ----------------------------------------------------------------------
49  // Types
50  // ----------------------------------------------------------------------
51 
53  typedef void (*CompFuncPtr)(
54  Fw::PassiveComponentBase* callComp,
55  NATIVE_INT_TYPE portNum,
56  U32 entry,
57  Svc::MeasurementStatus& status,
58  Fw::Time& time,
59  Fw::PolyType& val
60  );
61 
62  public:
63 
64  // ----------------------------------------------------------------------
65  // Input Port Member functions
66  // ----------------------------------------------------------------------
67 
69  InputPolyPort();
70 
72  void init();
73 
75  void addCallComp(
76  Fw::PassiveComponentBase* callComp,
77  CompFuncPtr funcPtr
78  );
79 
81  void invoke(
82  U32 entry,
83  Svc::MeasurementStatus& status,
84  Fw::Time& time,
85  Fw::PolyType& val
86  );
87 
88  private:
89 
90 #if FW_PORT_SERIALIZATION == 1
91 
93  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
94 
95 #endif
96 
97  private:
98 
99  // ----------------------------------------------------------------------
100  // Member variables
101  // ----------------------------------------------------------------------
102 
104  CompFuncPtr m_func;
105 
106  };
107 
111  public Fw::OutputPortBase
112  {
113 
114  public:
115 
116  // ----------------------------------------------------------------------
117  // Output Port Member functions
118  // ----------------------------------------------------------------------
119 
121  OutputPolyPort();
122 
124  void init();
125 
127  void addCallPort(
128  InputPolyPort* callPort
129  );
130 
132  void invoke(
133  U32 entry,
134  Svc::MeasurementStatus& status,
135  Fw::Time& time,
136  Fw::PolyType& val
137  );
138 
139  private:
140 
141  // ----------------------------------------------------------------------
142  // Member variables
143  // ----------------------------------------------------------------------
144 
146  InputPolyPort* m_port;
147 
148  };
149 
150 }
151 
152 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
Declares ISF string base class.
@ SERIALIZED_SIZE
stored serialized size
Definition: PolyType.hpp:165
Definition: Time.hpp:9
@ SERIALIZED_SIZE
Definition: Time.hpp:13
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: PolyPortAc.hpp:39
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PolyPortAc.cpp:62
void init()
Initialization function.
Definition: PolyPortAc.cpp:56
InputPolyPort()
Constructor.
Definition: PolyPortAc.cpp:48
void invoke(U32 entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
Invoke a port interface.
Definition: PolyPortAc.cpp:76
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, U32 entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
The port callback function type.
Definition: PolyPortAc.hpp:53
An enumeration for measurement status.
@ SERIALIZED_SIZE
The size of the serial representation.
void addCallPort(InputPolyPort *callPort)
Register an input port.
Definition: PolyPortAc.cpp:157
OutputPolyPort()
Constructor.
Definition: PolyPortAc.cpp:143
void invoke(U32 entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
Invoke a port interface.
Definition: PolyPortAc.cpp:170
void init()
Initialization function.
Definition: PolyPortAc.cpp:151
SerializeStatus
forward declaration for string