F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
BufferGetPortAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title BufferGetPortAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for BufferGet 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(U32 size)
47  {
48 #if FW_PORT_TRACING == 1
49  this->trace();
50 #endif
51 
52  FW_ASSERT(this->m_comp != nullptr);
53  FW_ASSERT(this->m_func != nullptr);
54 
55  return this->m_func(this->m_comp, this->m_portNum, size);
56  }
57 
58 #if FW_PORT_SERIALIZATION == 1
59 
60  Fw::SerializeStatus InputBufferGetPort ::
61  invokeSerial(Fw::SerializeBufferBase& _buffer)
62  {
63  // For ports with a return type, invokeSerial is not used
64  (void) _buffer;
65 
66  FW_ASSERT(0);
67  return Fw::FW_SERIALIZE_OK;
68  }
69 
70 #endif
71 
72  // ----------------------------------------------------------------------
73  // Output Port Member functions
74  // ----------------------------------------------------------------------
75 
78  Fw::OutputPortBase(),
79  m_port(nullptr)
80  {
81 
82  }
83 
85  init()
86  {
88  }
89 
92  {
93  FW_ASSERT(callPort != nullptr);
94 
95  this->m_port = callPort;
96  this->m_connObj = callPort;
97 
98 #if FW_PORT_SERIALIZATION == 1
99  this->m_serPort = nullptr;
100 #endif
101  }
102 
104  invoke(U32 size)
105  {
106 #if FW_PORT_TRACING == 1
107  this->trace();
108 #endif
109 
110  FW_ASSERT(this->m_port != nullptr);
111  return this->m_port->invoke(size);
112  }
113 
114 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
InputBufferGetPort()
Constructor.
Fw::Buffer invoke(U32 size)
Invoke a port interface.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
NATIVE_INT_TYPE m_portNum
virtual void init()
PassiveComponentBase * m_comp
void init()
Initialization function.
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
Fw::Buffer invoke(U32 size)
Invoke a port interface.
OutputBufferGetPort()
Constructor.
virtual void init()
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:33
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.