F´ Flight Software - C/C++ Documentation
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 
7 #include "Fw/Dp/DpGetPortAc.hpp"
8 #include "Fw/Types/Assert.hpp"
9 
10 namespace Fw {
11 
12 #if !FW_DIRECT_PORT_CALLS
13 
14  // ----------------------------------------------------------------------
15  // Public constructors for InputDpGetPort
16  // ----------------------------------------------------------------------
17 
20  Fw::InputPortBase(),
21  m_func(nullptr)
22  {
23 
24  }
25 
26  // ----------------------------------------------------------------------
27  // Public member functions for InputDpGetPort
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  FwDpIdType id,
53  FwSizeType dataSize,
54  Fw::Buffer& buffer
55  )
56  {
57 #if FW_PORT_TRACING == 1
58  this->trace();
59 #endif
60 
61  FW_ASSERT(this->m_comp != nullptr);
62  FW_ASSERT(this->m_func != nullptr);
63 
64  return this->m_func(this->m_comp, this->m_portNum, id, dataSize, buffer);
65  }
66 
67  // ----------------------------------------------------------------------
68  // Private member functions for InputDpGetPort
69  // ----------------------------------------------------------------------
70 
71 #if FW_PORT_SERIALIZATION == 1
72 
73  Fw::SerializeStatus InputDpGetPort ::
74  invokeSerial(Fw::LinearBufferBase& _buffer)
75  {
76  // For ports with a return type, invokeSerial is not used
77  (void) _buffer;
78 
79  FW_ASSERT(0);
80  return Fw::FW_SERIALIZE_OK;
81  }
82 
83 #endif
84 
85  // ----------------------------------------------------------------------
86  // Public constructors for OutputDpGetPort
87  // ----------------------------------------------------------------------
88 
91  Fw::OutputPortBase(),
92  m_port(nullptr)
93  {
94 
95  }
96 
97  // ----------------------------------------------------------------------
98  // Public member functions for OutputDpGetPort
99  // ----------------------------------------------------------------------
100 
101  void OutputDpGetPort ::
103  {
105  }
106 
107  void OutputDpGetPort ::
109  {
110  FW_ASSERT(callPort != nullptr);
111 
112  this->m_port = callPort;
113  this->m_connObj = callPort;
114 
115 #if FW_PORT_SERIALIZATION == 1
116  this->m_serPort = nullptr;
117 #endif
118  }
119 
122  FwDpIdType id,
123  FwSizeType dataSize,
124  Fw::Buffer& buffer
125  ) const
126  {
127 #if FW_PORT_TRACING == 1
128  this->trace();
129 #endif
130 
131  FW_ASSERT(this->m_port != nullptr);
132  return this->m_port->invoke(id, dataSize, buffer);
133  }
134 
135 #endif
136 
137 }
Serialization/Deserialization operation was successful.
PlatformSizeType FwSizeType
FwIndexType m_portNum
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: DpGetPortAc.cpp:37
Fw::Success invoke(FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer)
Invoke a port interface.
Definition: DpGetPortAc.cpp:51
SerializeStatus
forward declaration for string
void init() override
InputDpGetPort()
Constructor.
Definition: DpGetPortAc.cpp:19
OutputDpGetPort()
Constructor.
Definition: DpGetPortAc.cpp:90
FwIdType FwDpIdType
The type of a data product identifier.
PassiveComponentBase * m_comp
Fw::Success invoke(FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer) const
void addCallPort(InputDpGetPort *callPort)
Register an input port.
void init() override
Implementation of malloc based allocator.
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:34
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void init()
Initialization function.
Success/Failure.
void init()
Initialization function.
Definition: DpGetPortAc.cpp:31