F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CancelStatusPortAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CancelStatusPortAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for CancelStatus port
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 
10 namespace Svc {
11 
12 #if !FW_DIRECT_PORT_CALLS
13 
14  // ----------------------------------------------------------------------
15  // Public constructors for InputCancelStatusPort
16  // ----------------------------------------------------------------------
17 
20  Fw::InputPortBase(),
21  m_func(nullptr)
22  {
23 
24  }
25 
26  // ----------------------------------------------------------------------
27  // Public member functions for InputCancelStatusPort
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);
61  }
62 
63  // ----------------------------------------------------------------------
64  // Private member functions for InputCancelStatusPort
65  // ----------------------------------------------------------------------
66 
67 #if FW_PORT_SERIALIZATION == 1
68 
69  Fw::SerializeStatus InputCancelStatusPort ::
70  invokeSerial(Fw::LinearBufferBase& _buffer)
71  {
72 #if FW_PORT_TRACING == 1
73  this->trace();
74 #endif
75 
76  FW_ASSERT(this->m_comp != nullptr);
77  FW_ASSERT(this->m_func != nullptr);
78 
79  (void) _buffer;
80 
81  this->m_func(this->m_comp, this->m_portNum);
82 
83  return Fw::FW_SERIALIZE_OK;
84  }
85 
86 #endif
87 
88  // ----------------------------------------------------------------------
89  // Public constructors for OutputCancelStatusPort
90  // ----------------------------------------------------------------------
91 
94  Fw::OutputPortBase(),
95  m_port(nullptr)
96  {
97 
98  }
99 
100  // ----------------------------------------------------------------------
101  // Public member functions for OutputCancelStatusPort
102  // ----------------------------------------------------------------------
103 
106  {
108  }
109 
112  {
113  FW_ASSERT(callPort != nullptr);
114 
115  this->m_port = callPort;
116  this->m_connObj = callPort;
117 
118 #if FW_PORT_SERIALIZATION == 1
119  this->m_serPort = nullptr;
120 #endif
121  }
122 
124  invoke() const
125  {
126 #if FW_PORT_TRACING == 1
127  this->trace();
128 #endif
129 
130 #if FW_PORT_SERIALIZATION
131  FW_ASSERT((this->m_port != nullptr) || (this->m_serPort != nullptr));
132 
133  if (this->m_port != nullptr) {
134  this->m_port->invoke();
135  }
136  else {
137  Fw::SerializeStatus _status;
138  CancelStatusPortBuffer _buffer;
139 
140  _status = this->m_serPort->invokeSerial(_buffer);
141  FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_status));
142  }
143 #else
144  FW_ASSERT(this->m_port != nullptr);
145  this->m_port->invoke();
146 #endif
147  }
148 
149 #endif
150 
151 }
Serialization buffer for CancelStatus port.
Serialization/Deserialization operation was successful.
FwIndexType m_portNum
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init() override
void invoke() const
Invoke a port connection.
Input CancelStatus port.
void invoke()
Invoke a port interface.
PassiveComponentBase * m_comp
void init() override
RateGroupDivider component implementation.
Implementation of malloc based allocator.
void init()
Initialization function.
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:34
void init()
Initialization function.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void addCallPort(InputCancelStatusPort *callPort)
Register an input port.