F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComQueue.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComQueue.cpp
3 // \author vbai
4 // \brief cpp file for ComQueue component implementation class
5 // ======================================================================
6 
7 #include <Fw/Com/ComPacket.hpp>
8 #include <Fw/Types/Assert.hpp>
10 #include <type_traits>
11 #include "Fw/Types/BasicTypes.hpp"
12 
13 namespace Svc {
14 
15 // ----------------------------------------------------------------------
16 // Construction, initialization, and destruction
17 // ----------------------------------------------------------------------
18 
19 using FwUnsignedIndexType = std::make_unsigned<FwIndexType>::type;
20 
21 ComQueue ::QueueConfigurationTable ::QueueConfigurationTable() {
22  static_assert(static_cast<FwUnsignedIndexType>(std::numeric_limits<FwIndexType>::max()) >=
23  FW_NUM_ARRAY_ELEMENTS(this->entries),
24  "Number of entries must fit into FwIndexType");
25  for (FwIndexType i = 0; i < static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->entries)); i++) {
26  this->entries[i].priority = 0;
27  this->entries[i].depth = 0;
28  }
29 }
30 
31 ComQueue ::ComQueue(const char* const compName)
32  : ComQueueComponentBase(compName),
33  m_state(WAITING),
34  m_buffer_state(OWNED),
35  m_allocationId(static_cast<FwEnumStoreType>(-1)),
36  m_allocator(nullptr),
37  m_allocation(nullptr) {
38  // Initialize throttles to "off"
39  for (FwIndexType i = 0; i < TOTAL_PORT_COUNT; i++) {
40  this->m_throttle[i] = false;
41  }
42 }
43 
45 
47  // Deallocate memory ignoring error conditions
48  if ((this->m_allocator != nullptr) && (this->m_allocation != nullptr)) {
49  this->m_allocator->deallocate(this->m_allocationId, this->m_allocation);
50  }
51 }
52 
54  FwEnumStoreType allocationId,
55  Fw::MemAllocator& allocator) {
56  FwIndexType currentPriorityIndex = 0;
57  FwSizeType totalAllocation = 0;
58 
59  // Store/initialize allocator members
60  this->m_allocator = &allocator;
61  this->m_allocationId = allocationId;
62  this->m_allocation = nullptr;
63 
64  // Initializes the sorted queue metadata list in priority (sorted) order. This is accomplished by walking the
65  // priority values in priority order from 0 to TOTAL_PORT_COUNT. At each priory value, the supplied queue
66  // configuration table is walked and any entry matching the current priority values is used to add queue metadata to
67  // the prioritized list. This results in priority-sorted queue metadata objects that index back into the unsorted
68  // queue data structures.
69  //
70  // The total allocation size is tracked for passing to the allocation call and is a summation of
71  // (depth * message size) for each prioritized metadata object of (depth * message size)
72  for (FwIndexType currentPriority = 0; currentPriority < TOTAL_PORT_COUNT; currentPriority++) {
73  // Walk each queue configuration entry and add them into the prioritized metadata list when matching the current
74  // priority value
75  for (FwIndexType entryIndex = 0;
76  entryIndex < static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(queueConfig.entries)); entryIndex++) {
77  // Check for valid configuration entry
78  FW_ASSERT(queueConfig.entries[entryIndex].priority < TOTAL_PORT_COUNT,
79  static_cast<FwAssertArgType>(queueConfig.entries[entryIndex].priority),
80  static_cast<FwAssertArgType>(TOTAL_PORT_COUNT), static_cast<FwAssertArgType>(entryIndex));
81 
82  if (currentPriority == queueConfig.entries[entryIndex].priority) {
83  // Set up the queue metadata object in order to track priority, depth, index into the queue list of the
84  // backing queue object, and message size. Both index and message size are calculated where priority and
85  // depth are copied from the configuration object.
86  QueueMetadata& entry = this->m_prioritizedList[currentPriorityIndex];
87  entry.priority = queueConfig.entries[entryIndex].priority;
88  entry.depth = queueConfig.entries[entryIndex].depth;
89  entry.index = entryIndex;
90  // Message size is determined by the type of object being stored, which in turn is determined by the
91  // index of the entry. Those lower than COM_PORT_COUNT are Fw::ComBuffers and those larger Fw::Buffer.
92  entry.msgSize = (entryIndex < COM_PORT_COUNT) ? sizeof(Fw::ComBuffer) : sizeof(Fw::Buffer);
93  // Overflow checks
94  FW_ASSERT((std::numeric_limits<FwSizeType>::max() / entry.depth) >= entry.msgSize,
95  static_cast<FwAssertArgType>(entry.depth), static_cast<FwAssertArgType>(entry.msgSize));
96  FW_ASSERT(std::numeric_limits<FwSizeType>::max() - (entry.depth * entry.msgSize) >= totalAllocation);
97  totalAllocation += entry.depth * entry.msgSize;
98  currentPriorityIndex++;
99  }
100  }
101  }
102  // Allocate a single chunk of memory from the memory allocator. Memory recover is neither needed nor used.
103  bool recoverable = false;
104  this->m_allocation = this->m_allocator->allocate(this->m_allocationId, totalAllocation, recoverable);
105 
106  // Each of the backing queue objects must be supplied memory to store the queued messages. These data regions are
107  // sub-portions of the total allocated data. This memory is passed out by looping through each queue in prioritized
108  // order and passing out the memory to each queue's setup method.
109  FwSizeType allocationOffset = 0;
110  for (FwIndexType i = 0; i < TOTAL_PORT_COUNT; i++) {
111  // Get current queue's allocation size and safety check the values
112  FwSizeType allocationSize = this->m_prioritizedList[i].depth * this->m_prioritizedList[i].msgSize;
113  FW_ASSERT(this->m_prioritizedList[i].index < static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_queues)),
114  static_cast<FwAssertArgType>(this->m_prioritizedList[i].index));
115  FW_ASSERT((allocationSize + allocationOffset) <= totalAllocation, static_cast<FwAssertArgType>(allocationSize),
116  static_cast<FwAssertArgType>(allocationOffset), static_cast<FwAssertArgType>(totalAllocation));
117 
118  // Setup queue's memory allocation, depth, and message size. Setup is skipped for a depth 0 queue
119  if (allocationSize > 0) {
120  this->m_queues[this->m_prioritizedList[i].index].setup(
121  reinterpret_cast<U8*>(this->m_allocation) + allocationOffset, allocationSize,
122  this->m_prioritizedList[i].depth, this->m_prioritizedList[i].msgSize);
123  }
124  allocationOffset += allocationSize;
125  }
126  // Safety check that all memory was used as expected
127  FW_ASSERT(allocationOffset == totalAllocation, static_cast<FwAssertArgType>(allocationOffset),
128  static_cast<FwAssertArgType>(totalAllocation));
129 }
130 
131 // ----------------------------------------------------------------------
132 // Handler implementations for commands
133 // ----------------------------------------------------------------------
134 
135 void ComQueue ::FLUSH_QUEUE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::QueueType queueType, FwIndexType index) {
136  // Acquire the queue that we need to drain
137  FwIndexType queueIndex =
138  (queueType == QueueType::COM_QUEUE) ? index : static_cast<FwIndexType>(index + COM_PORT_COUNT);
139  this->drainQueue(queueIndex);
140  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
141 }
142 
143 void ComQueue ::FLUSH_ALL_QUEUES_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
144  for (FwIndexType i = 0; i < TOTAL_PORT_COUNT; i++) {
145  this->drainQueue(i);
146  }
147  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
148 }
149 
150 // ----------------------------------------------------------------------
151 // Handler implementations for user-defined typed input ports
152 // ----------------------------------------------------------------------
153 
154 void ComQueue::comPacketQueueIn_handler(const FwIndexType portNum, Fw::ComBuffer& data, U32 context) {
155  // Ensure that the port number of comPacketQueueIn is consistent with the expectation
156  FW_ASSERT(portNum >= 0 && portNum < COM_PORT_COUNT, static_cast<FwAssertArgType>(portNum));
157  (void)this->enqueue(portNum, QueueType::COM_QUEUE, reinterpret_cast<const U8*>(&data), sizeof(Fw::ComBuffer));
158 }
159 
160 void ComQueue::bufferQueueIn_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) {
161  FW_ASSERT(std::numeric_limits<FwIndexType>::max() - COM_PORT_COUNT > portNum);
162  const FwIndexType queueNum = static_cast<FwIndexType>(portNum + COM_PORT_COUNT);
163  // Ensure that the port number of bufferQueueIn is consistent with the expectation
164  FW_ASSERT(portNum >= 0 && portNum < BUFFER_PORT_COUNT, static_cast<FwAssertArgType>(portNum));
165  FW_ASSERT(queueNum < TOTAL_PORT_COUNT);
166  bool success =
167  this->enqueue(queueNum, QueueType::BUFFER_QUEUE, reinterpret_cast<const U8*>(&fwBuffer), sizeof(Fw::Buffer));
168  if (!success) {
169  this->bufferReturnOut_out(portNum, fwBuffer);
170  }
171 }
172 
173 void ComQueue::comStatusIn_handler(const FwIndexType portNum, Fw::Success& condition) {
174  switch (this->m_state) {
175  // On success, the queue should be processed. On failure, the component should still wait.
176  case WAITING:
177  if (condition.e == Fw::Success::SUCCESS) {
178  this->m_state = READY;
179  this->processQueue();
180  // A message may or may not be sent. Thus, READY or WAITING are acceptable final states.
181  FW_ASSERT((this->m_state == WAITING || this->m_state == READY),
182  static_cast<FwAssertArgType>(this->m_state));
183  } else {
184  this->m_state = WAITING;
185  }
186  break;
187  // Both READY and unknown states should not be possible at this point. To receive a status message we must be
188  // one of the WAITING or RETRY states.
189  default:
190  FW_ASSERT(0, static_cast<FwAssertArgType>(this->m_state));
191  break;
192  }
193 }
194 
195 void ComQueue::run_handler(const FwIndexType portNum, U32 context) {
196  // Downlink the high-water marks for the Fw::ComBuffer array types
197  ComQueueDepth comQueueDepth;
198  for (U32 i = 0; i < comQueueDepth.SIZE; i++) {
199  comQueueDepth[i] = static_cast<U32>(this->m_queues[i].get_high_water_mark());
200  this->m_queues[i].clear_high_water_mark();
201  }
202  this->tlmWrite_comQueueDepth(comQueueDepth);
203 
204  // Downlink the high-water marks for the Fw::Buffer array types
205  BuffQueueDepth buffQueueDepth;
206  for (U32 i = 0; i < buffQueueDepth.SIZE; i++) {
207  buffQueueDepth[i] = static_cast<U32>(this->m_queues[i + COM_PORT_COUNT].get_high_water_mark());
208  this->m_queues[i + COM_PORT_COUNT].clear_high_water_mark();
209  }
210  this->tlmWrite_buffQueueDepth(buffQueueDepth);
211 }
212 
213 void ComQueue ::dataReturnIn_handler(FwIndexType portNum, Fw::Buffer& data, const ComCfg::FrameContext& context) {
214  static_assert(std::numeric_limits<FwIndexType>::is_signed, "FwIndexType must be signed");
215  FW_ASSERT(this->m_buffer_state == UNOWNED);
216  this->m_buffer_state = OWNED;
217  // For the buffer queues, the index of the queue is portNum offset by COM_PORT_COUNT since
218  // the first COM_PORT_COUNT queues are for ComBuffer. So we have for buffer queues:
219  // queueNum = portNum + COM_PORT_COUNT
220  // Since queueNum is used as APID, we can retrieve the original portNum like such:
221  FwIndexType bufferReturnPortNum = static_cast<FwIndexType>(context.get_comQueueIndex() - ComQueue::COM_PORT_COUNT);
222  // Failing this assert means that context.apid was modified since ComQueue set it, which should not happen
223  FW_ASSERT(bufferReturnPortNum < BUFFER_PORT_COUNT, static_cast<FwAssertArgType>(bufferReturnPortNum));
224  if (bufferReturnPortNum >= 0) {
225  // It is a coding error not to connect the associated bufferReturnOut port for each dataReturnIn port
226  FW_ASSERT(this->isConnected_bufferReturnOut_OutputPort(bufferReturnPortNum),
227  static_cast<FwAssertArgType>(bufferReturnPortNum));
228  // If this is a buffer port, return the buffer to the BufferDownlink
229  this->bufferReturnOut_out(bufferReturnPortNum, data);
230  }
231 }
232 
233 // ----------------------------------------------------------------------
234 // Hook implementations for typed async input ports
235 // ----------------------------------------------------------------------
236 
237 void ComQueue::bufferQueueIn_overflowHook(FwIndexType portNum, Fw::Buffer& fwBuffer) {
238  FW_ASSERT(portNum >= 0 && portNum < BUFFER_PORT_COUNT, static_cast<FwAssertArgType>(portNum));
239  this->bufferReturnOut_out(portNum, fwBuffer);
240 }
241 
242 // ----------------------------------------------------------------------
243 // Private helper methods
244 // ----------------------------------------------------------------------
245 
246 bool ComQueue::enqueue(const FwIndexType queueNum, QueueType queueType, const U8* data, const FwSizeType size) {
247  // Enqueue the given message onto the matching queue. When no space is available then emit the queue overflow event,
248  // set the appropriate throttle, and move on. Will assert if passed a message for a depth 0 queue.
249  const FwSizeType expectedSize = (queueType == QueueType::COM_QUEUE) ? sizeof(Fw::ComBuffer) : sizeof(Fw::Buffer);
250  FW_ASSERT((queueType == QueueType::COM_QUEUE) || (queueNum >= COM_PORT_COUNT),
251  static_cast<FwAssertArgType>(queueType), static_cast<FwAssertArgType>(queueNum));
252  const FwIndexType portNum =
253  static_cast<FwIndexType>(queueNum - ((queueType == QueueType::COM_QUEUE) ? 0 : COM_PORT_COUNT));
254  bool rvStatus = true;
255  FW_ASSERT(expectedSize == size, static_cast<FwAssertArgType>(size), static_cast<FwAssertArgType>(expectedSize));
256  FW_ASSERT(portNum >= 0, static_cast<FwAssertArgType>(portNum));
257  Fw::SerializeStatus status = this->m_queues[queueNum].enqueue(data, size);
258  if (status == Fw::FW_SERIALIZE_NO_ROOM_LEFT) {
259  if (!this->m_throttle[queueNum]) {
260  this->log_WARNING_HI_QueueOverflow(queueType, static_cast<U32>(portNum));
261  this->m_throttle[queueNum] = true;
262  }
263 
264  rvStatus = false;
265  }
266  // When the component is already in READY state process the queue to send out the next available message immediately
267  if (this->m_state == READY) {
268  this->processQueue();
269  }
270 
271  return rvStatus;
272 }
273 
274 void ComQueue::sendComBuffer(Fw::ComBuffer& comBuffer, FwIndexType queueIndex) {
275  FW_ASSERT(this->m_state == READY);
276  Fw::Buffer outBuffer(comBuffer.getBuffAddr(), static_cast<Fw::Buffer::SizeType>(comBuffer.getSize()));
277 
278  // Context value is used to determine what to do when the buffer returns on the dataReturnIn port
279  ComCfg::FrameContext context;
280  FwPacketDescriptorType descriptor;
281  Fw::SerializeStatus status = comBuffer.deserializeTo(descriptor);
282  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
283  context.set_apid(static_cast<ComCfg::Apid::T>(descriptor));
284  context.set_comQueueIndex(queueIndex);
285  FW_ASSERT(this->m_buffer_state == OWNED);
286  this->m_buffer_state = UNOWNED;
287  this->dataOut_out(0, outBuffer, context);
288  // Set state to WAITING for the status to come back
289  this->m_state = WAITING;
290 }
291 
292 void ComQueue::sendBuffer(Fw::Buffer& buffer, FwIndexType queueIndex) {
293  // Retry buffer expected to be cleared as we are either transferring ownership or have already deallocated it.
294  FW_ASSERT(this->m_state == READY);
295 
296  // Context value is used to determine what to do when the buffer returns on the dataReturnIn port
297  ComCfg::FrameContext context;
298  FwPacketDescriptorType descriptor;
299  Fw::SerializeStatus status = buffer.getDeserializer().deserializeTo(descriptor);
300  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
301  context.set_apid(static_cast<ComCfg::Apid::T>(descriptor));
302  context.set_comQueueIndex(queueIndex);
303  FW_ASSERT(this->m_buffer_state == OWNED);
304  this->m_buffer_state = UNOWNED;
305  this->dataOut_out(0, buffer, context);
306  // Set state to WAITING for the status to come back
307  this->m_state = WAITING;
308 }
309 
310 void ComQueue::drainQueue(FwIndexType index) {
311  FW_ASSERT(index >= 0 && index < TOTAL_PORT_COUNT, static_cast<FwAssertArgType>(index));
312  Types::Queue& queue = this->m_queues[index];
313 
314  // Read all messages from the queue and discard them
316  const FwSizeType available = queue.getQueueSize();
317  for (FwSizeType i = 0; (i < available) && (status == Fw::FW_SERIALIZE_OK); i++) {
318  if (index < COM_PORT_COUNT) {
319  // Dequeueing is reading the whole persisted Fw::ComBuffer object from the queue's storage.
320  // thus it takes an address to the object to fill and the size of the actual object
321  Fw::ComBuffer comBuffer;
322  status = queue.dequeue(reinterpret_cast<U8*>(&comBuffer), sizeof(comBuffer));
323  } else {
324  // For buffer queues, if the buffer requires ownership return, return it via the bufferReturnOut port
325  // Dequeueing is reading the whole persisted Fw::Buffer object from the queue's storage.
326  Fw::Buffer buffer;
327  status = queue.dequeue(reinterpret_cast<U8*>(&buffer), sizeof(buffer));
328  this->bufferReturnOut_out(static_cast<FwIndexType>(index - COM_PORT_COUNT), buffer);
329  }
330  }
331 }
332 
333 void ComQueue::processQueue() {
334  FwIndexType priorityIndex = 0;
335  FwIndexType sendPriority = 0;
336  // Check that we are in the appropriate state
337  FW_ASSERT(this->m_state == READY);
338 
339  // Walk all the queues in priority order. Send the first message that is available in priority order. No balancing
340  // is done within this loop.
341  for (priorityIndex = 0; priorityIndex < TOTAL_PORT_COUNT; priorityIndex++) {
342  QueueMetadata& entry = this->m_prioritizedList[priorityIndex];
343  Types::Queue& queue = this->m_queues[entry.index];
344 
345  // Continue onto next prioritized queue if there is no items in the current queue
346  if (queue.getQueueSize() == 0) {
347  continue;
348  }
349 
350  // Send out the message based on the type
351  if (entry.index < COM_PORT_COUNT) {
352  // Dequeue is reading the whole persisted Fw::ComBuffer object from the queue's storage.
353  // thus it takes an address to the object to fill and the size of the actual object.
354  FW_ASSERT(this->m_buffer_state == OWNED);
355  auto dequeue_status =
356  queue.dequeue(reinterpret_cast<U8*>(&this->m_dequeued_com_buffer), sizeof(this->m_dequeued_com_buffer));
358  static_cast<FwAssertArgType>(dequeue_status));
359  this->sendComBuffer(this->m_dequeued_com_buffer, entry.index);
360  } else {
361  Fw::Buffer buffer;
362  auto dequeue_status = queue.dequeue(reinterpret_cast<U8*>(&buffer), sizeof(buffer));
364  static_cast<FwAssertArgType>(dequeue_status));
365  this->sendBuffer(buffer, entry.index);
366  }
367 
368  // Update the throttle and the index that was just sent
369  this->m_throttle[entry.index] = false;
370 
371  // Priority used in the next loop
372  sendPriority = entry.priority;
373  break;
374  }
375 
376  // Starting on the priority entry after the one dispatched and continuing through the end of the set of entries that
377  // share the same priority, rotate those entries such that the currently dispatched queue is last and the rest are
378  // shifted up by one. This effectively round-robins the queues of the same priority.
379  for (priorityIndex++;
380  priorityIndex < TOTAL_PORT_COUNT && (this->m_prioritizedList[priorityIndex].priority == sendPriority);
381  priorityIndex++) {
382  // Swap the previous entry with this one.
383  QueueMetadata temp = this->m_prioritizedList[priorityIndex];
384  this->m_prioritizedList[priorityIndex] = this->m_prioritizedList[priorityIndex - 1];
385  this->m_prioritizedList[priorityIndex - 1] = temp;
386  }
387 }
388 } // end namespace Svc
Serialization/Deserialization operation was successful.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
U16 FwPacketDescriptorType
The width of packet descriptors when they are serialized by the framework.
virtual void * allocate(const FwEnumStoreType identifier, FwSizeType &size, bool &recoverable, FwSizeType alignment=alignof(std::max_align_t))=0
FwIdType FwOpcodeType
The type of a command opcode.
std::make_unsigned< FwIndexType >::type FwUnsignedIndexType
Definition: ComQueue.cpp:19
Representing success.
PlatformSizeType FwSizeType
void tlmWrite_buffQueueDepth(const Svc::BuffQueueDepth &arg, Fw::Time _tlmTime=Fw::Time()) const
T e
The raw enum value.
I32 FwEnumStoreType
QueueConfigurationEntry entries[TOTAL_PORT_COUNT]
Definition: ComQueue.hpp:66
configuration table for each queue
Definition: ComQueue.hpp:65
static const FwIndexType TOTAL_PORT_COUNT
Total count of input buffer ports and thus total queues.
Definition: ComQueue.hpp:38
ComQueue(const char *const compName)
Definition: ComQueue.cpp:31
Serializable::SizeType getSize() const override
Get current buffer size.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
No room left in the buffer to serialize data.
void set_apid(ComCfg::Apid::T apid)
Set member apid.
void clear_high_water_mark()
Definition: Queue.cpp:52
bool isConnected_bufferReturnOut_OutputPort(FwIndexType portNum)
void cleanup()
Definition: ComQueue.cpp:46
static const FwIndexType BUFFER_PORT_COUNT
Definition: ComQueue.hpp:33
static const FwIndexType COM_PORT_COUNT
< Count of Fw::Com input ports and thus Fw::Com queues
Definition: ComQueue.hpp:30
void setup(U8 *const storage, const FwSizeType storage_size, const FwSizeType depth, const FwSizeType message_size)
setup the queue object to setup storage
Definition: Queue.cpp:17
An enumeration of queue data types.
FwIndexType get_comQueueIndex() const
Get member comQueueIndex.
SerializeStatus
forward declaration for string
ExternalSerializeBufferWithMemberCopy getDeserializer()
Definition: Buffer.cpp:105
FwIndexType priority
Priority of the queue [0, TOTAL_PORT_COUNT)
Definition: ComQueue.hpp:53
Fw::SerializeStatus enqueue(const U8 *const message, const FwSizeType size)
pushes a fixed-size message onto the back of the queue
Definition: Queue.cpp:29
FwSizeType depth
Depth of the queue [0, infinity)
Definition: ComQueue.hpp:52
void log_WARNING_HI_QueueOverflow(Svc::QueueType queueType, U32 index) const
U8 * getBuffAddr()
Get buffer address for data filling (non-const version)
Definition: ComBuffer.cpp:42
Command successfully executed.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
Memory Allocation base class.
void set_comQueueIndex(FwIndexType comQueueIndex)
Set member comQueueIndex.
FwSizeType get_high_water_mark() const
Definition: Queue.cpp:47
PlatformIndexType FwIndexType
FwSizeType SizeType
The size type for a buffer - for backwards compatibility.
Definition: Buffer.hpp:61
C++ header for working with basic fprime types.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:90
Type used to pass context info between components during framing/deframing.
void tlmWrite_comQueueDepth(const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time()) const
RateGroupDivider component implementation.
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
virtual void deallocate(const FwEnumStoreType identifier, void *ptr)=0
FwSizeType getQueueSize() const
Definition: Queue.cpp:56
Fw::SerializeStatus dequeue(U8 *const message, const FwSizeType size)
pops a fixed-size message off the front of the queue
Definition: Queue.cpp:36
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Success/Failure.
void configure(QueueConfigurationTable queueConfig, FwEnumStoreType allocationId, Fw::MemAllocator &allocator)
Definition: ComQueue.cpp:53
Auto-generated base for ComQueue component.
void bufferReturnOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferReturnOut.