F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Queue.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Stub/Queue.hpp
3 // \brief stub definitions for Os::Queue
4 // ======================================================================
5 #ifndef OS_STUB_QUEUE_HPP
6 #define OS_STUB_QUEUE_HPP
7 #include "Os/Queue.hpp"
8 
9 namespace Os {
10 namespace Stub {
11 namespace Queue {
12 
13 struct StubQueueHandle : public QueueHandle {};
14 
16 class StubQueue : public QueueInterface {
17  public:
19  StubQueue() = default;
20 
22  virtual ~StubQueue() = default;
23 
25  StubQueue(const QueueInterface& other) = delete;
26 
28  StubQueue(const QueueInterface* other) = delete;
29 
31  StubQueue& operator=(const QueueInterface& other) override = delete;
32 
40  Status create(const Fw::StringBase& name, FwSizeType depth, FwSizeType messageSize) override;
41 
53  Status send(const U8* buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override;
54 
67  Status receive(U8* destination,
68  FwSizeType capacity,
69  BlockingType blockType,
70  FwSizeType& actualSize,
71  FwQueuePriorityType& priority) override;
72 
76  FwSizeType getMessagesAvailable() const override;
77 
83  FwSizeType getMessageHighWaterMark() const override;
84 
85  QueueHandle* getHandle() override;
86 
88 };
89 
90 } // namespace Queue
91 } // namespace Stub
92 } // namespace Os
93 
94 #endif // OS_STUB_QUEUE_HPP
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
PlatformQueuePriorityType FwQueuePriorityType
Definition: FpConfig.h:55
QueueHandle parent class.
Definition: Queue.hpp:19
base queue interface
Definition: Queue.hpp:27
BlockingType
message type
Definition: Queue.hpp:44
Status
status returned from the queue send function
Definition: Queue.hpp:30
stub queue implementation with injectable statuses
Definition: Queue.hpp:16
QueueHandle * getHandle() override
return the underlying queue handle (implementation specific)
Definition: Queue.cpp:38
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue
Definition: Queue.cpp:22
FwSizeType getMessagesAvailable() const override
get number of messages available
Definition: Queue.cpp:30
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue
Definition: Queue.cpp:15
StubQueue & operator=(const QueueInterface &other) override=delete
assignment operator is forbidden
StubQueue(const QueueInterface *other)=delete
copy constructor is forbidden
Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage
Definition: Queue.cpp:11
virtual ~StubQueue()=default
default queue destructor
StubQueue(const QueueInterface &other)=delete
copy constructor is forbidden
FwSizeType getMessageHighWaterMark() const override
get maximum messages stored at any given time
Definition: Queue.cpp:34
StubQueueHandle m_handle
Definition: Queue.hpp:87
StubQueue()=default
default queue interface constructor