F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
DpSendPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpSendPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DpSend port
5 // ======================================================================
6 
7 #ifndef Fw_DpSendPortAc_HPP
8 #define Fw_DpSendPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
13 #include "FpConfig.hpp"
14 #include "Fw/Buffer/Buffer.hpp"
19 #include "Fw/Types/StringType.hpp"
20 
21 namespace Fw {
22 
26  public Fw::InputPortBase
27  {
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Constants
33  // ----------------------------------------------------------------------
34 
35  enum {
38  sizeof(FwDpIdType) +
40  };
41 
42  public:
43 
44  // ----------------------------------------------------------------------
45  // Types
46  // ----------------------------------------------------------------------
47 
49  typedef void (*CompFuncPtr)(
50  Fw::PassiveComponentBase* callComp,
51  FwIndexType portNum,
52  FwDpIdType id,
53  const Fw::Buffer& buffer
54  );
55 
56  public:
57 
58  // ----------------------------------------------------------------------
59  // Input Port Member functions
60  // ----------------------------------------------------------------------
61 
64 
66  void init();
67 
69  void addCallComp(
70  Fw::PassiveComponentBase* callComp,
71  CompFuncPtr funcPtr
72  );
73 
75  void invoke(
76  FwDpIdType id,
77  const Fw::Buffer& buffer
78  );
79 
80  private:
81 
82 #if FW_PORT_SERIALIZATION == 1
83 
85  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
86 
87 #endif
88 
89  private:
90 
91  // ----------------------------------------------------------------------
92  // Member variables
93  // ----------------------------------------------------------------------
94 
96  CompFuncPtr m_func;
97 
98  };
99 
103  public Fw::OutputPortBase
104  {
105 
106  public:
107 
108  // ----------------------------------------------------------------------
109  // Output Port Member functions
110  // ----------------------------------------------------------------------
111 
114 
116  void init();
117 
119  void addCallPort(
120  InputDpSendPort* callPort
121  );
122 
124  void invoke(
125  FwDpIdType id,
126  const Fw::Buffer& buffer
127  );
128 
129  private:
130 
131  // ----------------------------------------------------------------------
132  // Member variables
133  // ----------------------------------------------------------------------
134 
136  InputDpSendPort* m_port;
137 
138  };
139 
140 }
141 
142 #endif
U32 FwDpIdType
Definition: FpConfig.h:102
PlatformIndexType FwIndexType
Definition: FpConfig.h:20
C++-compatible configuration header for fprime configuration.
@ SERIALIZED_SIZE
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:48
InputDpSendPort()
Constructor.
void init()
Initialization function.
void invoke(FwDpIdType id, const Fw::Buffer &buffer)
Invoke a port interface.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwDpIdType id, const Fw::Buffer &buffer)
The port callback function type.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
OutputDpSendPort()
Constructor.
void addCallPort(InputDpSendPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(FwDpIdType id, const Fw::Buffer &buffer)
Invoke a port interface.
SerializeStatus
forward declaration for string