F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ComPortAc.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title ComPortAc.hpp
3// \author Generated by fpp-to-cpp
4// \brief hpp file for Com port
5// ======================================================================
6
7#ifndef Fw_ComPortAc_HPP
8#define Fw_ComPortAc_HPP
9
10#include <cstdio>
11#include <cstring>
12
13#include "FpConfig.hpp"
14#include "Fw/Com/ComBuffer.hpp"
20
21namespace Fw {
22
27 {
28
29 public:
30
31 // ----------------------------------------------------------------------
32 // Constants
33 // ----------------------------------------------------------------------
34
35 enum {
39 sizeof(U32)
40 };
41
42 public:
43
44 // ----------------------------------------------------------------------
45 // Types
46 // ----------------------------------------------------------------------
47
49 typedef void (*CompFuncPtr)(
51 NATIVE_INT_TYPE portNum,
52 Fw::ComBuffer& data,
53 U32 context
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 Fw::ComBuffer& data,
77 U32 context
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 InputComPort* callPort
121 );
122
124 void invoke(
125 Fw::ComBuffer& data,
126 U32 context
127 );
128
129 private:
130
131 // ----------------------------------------------------------------------
132 // Member variables
133 // ----------------------------------------------------------------------
134
136 InputComPort* m_port;
137
138 };
139
140}
141
142#endif
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
Declares ISF string base class.
void invoke(Fw::ComBuffer &data, U32 context)
Invoke a port interface.
Definition ComPortAc.cpp:76
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition ComPortAc.hpp:37
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
The port callback function type.
Definition ComPortAc.hpp:49
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition ComPortAc.cpp:62
InputComPort()
Constructor.
Definition ComPortAc.cpp:48
void init()
Initialization function.
Definition ComPortAc.cpp:56
void addCallPort(InputComPort *callPort)
Register an input port.
OutputComPort()
Constructor.
void init()
Initialization function.
void invoke(Fw::ComBuffer &data, U32 context)
Invoke a port interface.
SerializeStatus
forward declaration for string