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