F´ Flight Software - C/C++ Documentation
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"
9 
10 namespace Fw {
11 
12 #if !FW_DIRECT_PORT_CALLS
13 
14  // ----------------------------------------------------------------------
15  // Public constructors for InputBufferGetPort
16  // ----------------------------------------------------------------------
17 
20  Fw::InputPortBase(),
21  m_func(nullptr)
22  {
23 
24  }
25 
26  // ----------------------------------------------------------------------
27  // Public member functions for InputBufferGetPort
28  // ----------------------------------------------------------------------
29 
32  {
34  }
35 
38  Fw::PassiveComponentBase* callComp,
39  CompFuncPtr funcPtr
40  )
41  {
42  FW_ASSERT(callComp != nullptr);
43  FW_ASSERT(funcPtr != nullptr);
44 
45  this->m_comp = callComp;
46  this->m_func = funcPtr;
47  this->m_connObj = callComp;
48  }
49 
52  {
53 #if FW_PORT_TRACING == 1
54  this->trace();
55 #endif
56 
57  FW_ASSERT(this->m_comp != nullptr);
58  FW_ASSERT(this->m_func != nullptr);
59 
60  return this->m_func(this->m_comp, this->m_portNum, size);
61  }
62 
63  // ----------------------------------------------------------------------
64  // Private member functions for InputBufferGetPort
65  // ----------------------------------------------------------------------
66 
67 #if FW_PORT_SERIALIZATION == 1
68 
69  Fw::SerializeStatus InputBufferGetPort ::
70  invokeSerial(Fw::LinearBufferBase& _buffer)
71  {
72  // For ports with a return type, invokeSerial is not used
73  (void) _buffer;
74 
75  FW_ASSERT(0);
76  return Fw::FW_SERIALIZE_OK;
77  }
78 
79 #endif
80 
81  // ----------------------------------------------------------------------
82  // Public constructors for OutputBufferGetPort
83  // ----------------------------------------------------------------------
84 
87  Fw::OutputPortBase(),
88  m_port(nullptr)
89  {
90 
91  }
92 
93  // ----------------------------------------------------------------------
94  // Public member functions for OutputBufferGetPort
95  // ----------------------------------------------------------------------
96 
99  {
101  }
102 
105  {
106  FW_ASSERT(callPort != nullptr);
107 
108  this->m_port = callPort;
109  this->m_connObj = callPort;
110 
111 #if FW_PORT_SERIALIZATION == 1
112  this->m_serPort = nullptr;
113 #endif
114  }
115 
117  invoke(FwSizeType size) const
118  {
119 #if FW_PORT_TRACING == 1
120  this->trace();
121 #endif
122 
123  FW_ASSERT(this->m_port != nullptr);
124  return this->m_port->invoke(size);
125  }
126 
127 #endif
128 
129 }
Serialization/Deserialization operation was successful.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
PlatformSizeType FwSizeType
FwIndexType m_portNum
SerializeStatus
forward declaration for string
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
void init() override
Fw::Buffer invoke(FwSizeType size)
Invoke a port interface.
Fw::Buffer invoke(FwSizeType size) const
void init()
Initialization function.
PassiveComponentBase * m_comp
InputBufferGetPort()
Constructor.
void init() override
void init()
Initialization function.
OutputBufferGetPort()
Constructor.
Implementation of malloc based allocator.
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:34
#define FW_ASSERT(...)
Definition: Assert.hpp:14