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