F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
CmdSeqCancelPortAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CmdSeqCancelPortAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for CmdSeqCancel port
5 // ======================================================================
6 
8 #include "Fw/Types/Assert.hpp"
10 
11 namespace Svc {
12 
13  namespace {
14 
15  // ----------------------------------------------------------------------
16  // Port buffer class
17  // ----------------------------------------------------------------------
18 
19  class CmdSeqCancelPortBuffer : public Fw::SerializeBufferBase {
20 
21  public:
22 
23  NATIVE_UINT_TYPE getBuffCapacity() const {
25  }
26 
27  U8* getBuffAddr() {
28  return nullptr;
29  }
30 
31  const U8* getBuffAddr() const {
32  return nullptr;
33  }
34 
35  };
36 
37  }
38 
39  // ----------------------------------------------------------------------
40  // Input Port Member functions
41  // ----------------------------------------------------------------------
42 
45  Fw::InputPortBase(),
46  m_func(nullptr)
47  {
48 
49  }
50 
52  init()
53  {
55  }
56 
59  Fw::PassiveComponentBase* callComp,
60  CompFuncPtr funcPtr
61  )
62  {
63  FW_ASSERT(callComp != nullptr);
64  FW_ASSERT(funcPtr != nullptr);
65 
66  this->m_comp = callComp;
67  this->m_func = funcPtr;
68  this->m_connObj = callComp;
69  }
70 
72  invoke()
73  {
74 #if FW_PORT_TRACING == 1
75  this->trace();
76 #endif
77 
78  FW_ASSERT(this->m_comp != nullptr);
79  FW_ASSERT(this->m_func != nullptr);
80 
81  return this->m_func(this->m_comp, this->m_portNum);
82  }
83 
84 #if FW_PORT_SERIALIZATION == 1
85 
86  Fw::SerializeStatus InputCmdSeqCancelPort ::
87  invokeSerial(Fw::SerializeBufferBase& _buffer)
88  {
89  (void) _buffer;
90 
91 #if FW_PORT_TRACING == 1
92  this->trace();
93 #endif
94 
95  FW_ASSERT(this->m_comp != nullptr);
96  FW_ASSERT(this->m_func != nullptr);
97 
98  this->m_func(this->m_comp, this->m_portNum);
99 
100  return Fw::FW_SERIALIZE_OK;
101  }
102 
103 #endif
104 
105  // ----------------------------------------------------------------------
106  // Output Port Member functions
107  // ----------------------------------------------------------------------
108 
111  Fw::OutputPortBase(),
112  m_port(nullptr)
113  {
114 
115  }
116 
118  init()
119  {
121  }
122 
125  {
126  FW_ASSERT(callPort != nullptr);
127 
128  this->m_port = callPort;
129  this->m_connObj = callPort;
130 
131 #if FW_PORT_SERIALIZATION == 1
132  this->m_serPort = nullptr;
133 #endif
134  }
135 
137  invoke()
138  {
139 #if FW_PORT_TRACING == 1
140  this->trace();
141 #endif
142 
143 #if FW_PORT_SERIALIZATION
144  FW_ASSERT((this->m_port != nullptr) || (this->m_serPort != nullptr));
145 
146  if (this->m_port != nullptr) {
147  this->m_port->invoke();
148  }
149  else {
150  Fw::SerializeStatus _status;
151  CmdSeqCancelPortBuffer _buffer;
152 
153  _status = this->m_serPort->invokeSerial(_buffer);
154  FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_status));
155  }
156 #else
157  FW_ASSERT(this->m_port != nullptr);
158  this->m_port->invoke();
159 #endif
160  }
161 
162 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:26
PlatformUIntType NATIVE_UINT_TYPE
Definition: BasicTypes.h:52
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:21
NATIVE_INT_TYPE m_portNum
virtual void init()
PassiveComponentBase * m_comp
virtual void init()
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:33
void invoke()
Invoke a port interface.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void invoke()
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputCmdSeqCancelPort *callPort)
Register an input port.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.