F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
DpGetPortAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpGetPortAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for DpGet port
5 // ======================================================================
6 
8 #include "Fw/Types/Assert.hpp"
10 
11 namespace Fw {
12 
13  // ----------------------------------------------------------------------
14  // Input Port Member functions
15  // ----------------------------------------------------------------------
16 
19  Fw::InputPortBase(),
20  m_func(nullptr)
21  {
22 
23  }
24 
26  init()
27  {
29  }
30 
33  Fw::PassiveComponentBase* callComp,
34  CompFuncPtr funcPtr
35  )
36  {
37  FW_ASSERT(callComp != nullptr);
38  FW_ASSERT(funcPtr != nullptr);
39 
40  this->m_comp = callComp;
41  this->m_func = funcPtr;
42  this->m_connObj = callComp;
43  }
44 
46  invoke(
47  FwDpIdType id,
48  FwSizeType dataSize,
49  Fw::Buffer& buffer
50  )
51  {
52 #if FW_PORT_TRACING == 1
53  this->trace();
54 #endif
55 
56  FW_ASSERT(this->m_comp != nullptr);
57  FW_ASSERT(this->m_func != nullptr);
58 
59  return this->m_func(this->m_comp, this->m_portNum, id, dataSize, buffer);
60  }
61 
62 #if FW_PORT_SERIALIZATION == 1
63 
64  Fw::SerializeStatus InputDpGetPort ::
65  invokeSerial(Fw::SerializeBufferBase& _buffer)
66  {
67  // For ports with a return type, invokeSerial is not used
68  (void) _buffer;
69 
70  FW_ASSERT(0);
71  return Fw::FW_SERIALIZE_OK;
72  }
73 
74 #endif
75 
76  // ----------------------------------------------------------------------
77  // Output Port Member functions
78  // ----------------------------------------------------------------------
79 
82  Fw::OutputPortBase(),
83  m_port(nullptr)
84  {
85 
86  }
87 
89  init()
90  {
92  }
93 
96  {
97  FW_ASSERT(callPort != nullptr);
98 
99  this->m_port = callPort;
100  this->m_connObj = callPort;
101 
102 #if FW_PORT_SERIALIZATION == 1
103  this->m_serPort = nullptr;
104 #endif
105  }
106 
108  invoke(
109  FwDpIdType id,
110  FwSizeType dataSize,
111  Fw::Buffer& buffer
112  )
113  {
114 #if FW_PORT_TRACING == 1
115  this->trace();
116 #endif
117 
118  FW_ASSERT(this->m_port != nullptr);
119  return this->m_port->invoke(id, dataSize, buffer);
120  }
121 
122 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
U32 FwDpIdType
Definition: FpConfig.h:115
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
void init()
Initialization function.
Definition: DpGetPortAc.cpp:26
InputDpGetPort()
Constructor.
Definition: DpGetPortAc.cpp:18
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: DpGetPortAc.cpp:32
Fw::Success invoke(FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer)
Invoke a port interface.
Definition: DpGetPortAc.cpp:46
NATIVE_INT_TYPE m_portNum
virtual void init()
PassiveComponentBase * m_comp
OutputDpGetPort()
Constructor.
Definition: DpGetPortAc.cpp:81
Fw::Success invoke(FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer)
Invoke a port interface.
void init()
Initialization function.
Definition: DpGetPortAc.cpp:89
void addCallPort(InputDpGetPort *callPort)
Register an input port.
Definition: DpGetPortAc.cpp:95
virtual void init()
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:33
Success/Failure.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.