F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CompressChunkPortAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CompressChunkPortAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for CompressChunk 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 InputCompressChunkPort
16  // ----------------------------------------------------------------------
17 
20  Fw::InputPortBase(),
21  m_func(nullptr)
22  {
23 
24  }
25 
26  // ----------------------------------------------------------------------
27  // Public member functions for InputCompressChunkPort
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  Fw::Buffer& buffer,
53  FwSizeType min_compression,
54  FwSizeType write_offset
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, buffer, min_compression, write_offset);
65  }
66 
67  // ----------------------------------------------------------------------
68  // Private member functions for InputCompressChunkPort
69  // ----------------------------------------------------------------------
70 
71 #if FW_PORT_SERIALIZATION == 1
72 
73  Fw::SerializeStatus InputCompressChunkPort ::
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 OutputCompressChunkPort
87  // ----------------------------------------------------------------------
88 
91  Fw::OutputPortBase(),
92  m_port(nullptr)
93  {
94 
95  }
96 
97  // ----------------------------------------------------------------------
98  // Public member functions for OutputCompressChunkPort
99  // ----------------------------------------------------------------------
100 
103  {
105  }
106 
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  Fw::Buffer& buffer,
123  FwSizeType min_compression,
124  FwSizeType write_offset
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(buffer, min_compression, write_offset);
133  }
134 
135 #endif
136 
137 }
Serialization/Deserialization operation was successful.
PlatformSizeType FwSizeType
FwIndexType m_portNum
SerializeStatus
forward declaration for string
void addCallPort(InputCompressChunkPort *callPort)
Register an input port.
void init()
Initialization function.
Svc::CompressionAlgorithm invoke(Fw::Buffer &buffer, FwSizeType min_compression, FwSizeType write_offset)
Invoke a port interface.
void init() override
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
Svc::CompressionAlgorithm invoke(Fw::Buffer &buffer, FwSizeType min_compression, FwSizeType write_offset) const
PassiveComponentBase * m_comp
void init() override
RateGroupDivider component implementation.
Input CompressChunk port.
Implementation of malloc based allocator.
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:34
#define FW_ASSERT(...)
Definition: Assert.hpp:14