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"
23 
24 namespace Svc {
25 
28  class InputPolyPort :
29  public Fw::InputPortBase
30  {
31 
32  public:
33 
34  // ----------------------------------------------------------------------
35  // Constants
36  // ----------------------------------------------------------------------
37 
38  enum {
45  };
46 
47  public:
48 
49  // ----------------------------------------------------------------------
50  // Types
51  // ----------------------------------------------------------------------
52 
54  typedef void (*CompFuncPtr)(
55  Fw::PassiveComponentBase* callComp,
56  FwIndexType portNum,
57  const Svc::PolyDbCfg::PolyDbEntry& entry,
58  Svc::MeasurementStatus& status,
59  Fw::Time& time,
60  Fw::PolyType& val
61  );
62 
63  public:
64 
65  // ----------------------------------------------------------------------
66  // Input Port Member functions
67  // ----------------------------------------------------------------------
68 
70  InputPolyPort();
71 
73  void init();
74 
76  void addCallComp(
77  Fw::PassiveComponentBase* callComp,
78  CompFuncPtr funcPtr
79  );
80 
82  void invoke(
83  const Svc::PolyDbCfg::PolyDbEntry& entry,
84  Svc::MeasurementStatus& status,
85  Fw::Time& time,
86  Fw::PolyType& val
87  );
88 
89  private:
90 
91 #if FW_PORT_SERIALIZATION == 1
92 
94  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
95 
96 #endif
97 
98  private:
99 
100  // ----------------------------------------------------------------------
101  // Member variables
102  // ----------------------------------------------------------------------
103 
105  CompFuncPtr m_func;
106 
107  };
108 
112  public Fw::OutputPortBase
113  {
114 
115  public:
116 
117  // ----------------------------------------------------------------------
118  // Output Port Member functions
119  // ----------------------------------------------------------------------
120 
122  OutputPolyPort();
123 
125  void init();
126 
128  void addCallPort(
129  InputPolyPort* callPort
130  );
131 
133  void invoke(
134  const Svc::PolyDbCfg::PolyDbEntry& entry,
135  Svc::MeasurementStatus& status,
136  Fw::Time& time,
137  Fw::PolyType& val
138  );
139 
140  private:
141 
142  // ----------------------------------------------------------------------
143  // Member variables
144  // ----------------------------------------------------------------------
145 
147  InputPolyPort* m_port;
148 
149  };
150 
151 }
152 
153 #endif
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
@ SERIALIZED_SIZE
stored serialized size
Definition: PolyType.hpp:162
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:40
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PolyPortAc.cpp:62
void init()
Initialization function.
Definition: PolyPortAc.cpp:56
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
The port callback function type.
Definition: PolyPortAc.hpp:54
InputPolyPort()
Constructor.
Definition: PolyPortAc.cpp:48
void invoke(const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
Invoke a port interface.
Definition: PolyPortAc.cpp:76
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 init()
Initialization function.
Definition: PolyPortAc.cpp:151
void invoke(const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
Invoke a port interface.
Definition: PolyPortAc.cpp:170
@ SERIALIZED_SIZE
The size of the serial representation.
SerializeStatus
forward declaration for string