SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::msgq< T, LEN > Class Template Reference

#include <bsp.hpp>

Inheritance diagram for satnogs::comms::msgq< T, LEN >:
satnogs::comms::lib::bsp::msgq< T, LEN > satnogs::comms::lib::bsp::imsgq< T >

Public Member Functions

 msgq ()
size_t size ()
 A virtual method that returns the current number of messages in the queue.
uint32_t free_space ()
int put (const T &msg, size_t timeout_ms)
 A virtual method that enqueues a message into the queue.
int put_isr (const T &msg)
 A virtual method that enqueues a message into the queue from an interrupt context.
int peek (T *msg)
 A virtual method that peeks at the next message in the queue without removing it.
void purge ()
int get (T *msg, size_t timeout_ms)
 A virtual method that retrieves a message from the queue.
int get_isr (T *msg)
 A virtual method that retrieves a message from the queue from an interrupt context.
Public Member Functions inherited from satnogs::comms::lib::bsp::msgq< T, LEN >
 msgq ()
Public Member Functions inherited from satnogs::comms::lib::bsp::imsgq< T >
 imsgq (size_t len)
 Constructs an imsgq object with a specified maximum size.
 imsgq (const imsgq &)=delete
size_t max_size () const
 A method that returns the maximum size of the message queue.

Additional Inherited Members

Protected Attributes inherited from satnogs::comms::lib::bsp::imsgq< T >
const size_t m_len

Detailed Description

template<typename T, const size_t LEN>
class satnogs::comms::msgq< T, LEN >

Definition at line 347 of file bsp.hpp.

Constructor & Destructor Documentation

◆ msgq()

template<typename T, const size_t LEN>
satnogs::comms::msgq< T, LEN >::msgq ( )
inline

Definition at line 350 of file bsp.hpp.

Member Function Documentation

◆ free_space()

template<typename T, const size_t LEN>
uint32_t satnogs::comms::msgq< T, LEN >::free_space ( )
inline

Definition at line 362 of file bsp.hpp.

◆ get()

template<typename T, const size_t LEN>
int satnogs::comms::msgq< T, LEN >::get ( T * msg,
size_t timeout_ms )
inlinevirtual

A virtual method that retrieves a message from the queue.

Parameters
msgPointer to store the retrieved message of type T.
timeout_msThe timeout in milliseconds to wait if the queue is empty.
Returns
success or error code
Note
Must be implemented by the inherited class.

Implements satnogs::comms::lib::bsp::imsgq< T >.

Definition at line 392 of file bsp.hpp.

◆ get_isr()

template<typename T, const size_t LEN>
int satnogs::comms::msgq< T, LEN >::get_isr ( T * msg)
inlinevirtual

A virtual method that retrieves a message from the queue from an interrupt context.

Parameters
msgPointer to store the retrieved message.
Returns
success or error code
Note
Must be implemented by the inherited class.

Implements satnogs::comms::lib::bsp::imsgq< T >.

Definition at line 398 of file bsp.hpp.

◆ peek()

template<typename T, const size_t LEN>
int satnogs::comms::msgq< T, LEN >::peek ( T * msg)
inlinevirtual

A virtual method that peeks at the next message in the queue without removing it.

Parameters
msgPointer to store the peeked message of type T.
Returns
success or error code
Note
Must be implemented by the inherited class.

Implements satnogs::comms::lib::bsp::imsgq< T >.

Definition at line 380 of file bsp.hpp.

◆ purge()

template<typename T, const size_t LEN>
void satnogs::comms::msgq< T, LEN >::purge ( )
inline

Definition at line 386 of file bsp.hpp.

◆ put()

template<typename T, const size_t LEN>
int satnogs::comms::msgq< T, LEN >::put ( const T & msg,
size_t timeout_ms )
inlinevirtual

A virtual method that enqueues a message into the queue.

Parameters
msgThe message of type T to enqueue.
timeout_msThe timeout in milliseconds to wait if the queue is full.
Returns
success or error code
Note
Must be implemented by the inherited class.

Implements satnogs::comms::lib::bsp::imsgq< T >.

Definition at line 368 of file bsp.hpp.

◆ put_isr()

template<typename T, const size_t LEN>
int satnogs::comms::msgq< T, LEN >::put_isr ( const T & msg)
inlinevirtual

A virtual method that enqueues a message into the queue from an interrupt context.

Parameters
msgThe message of type T to enqueue.
Returns
success or error code
Note
Must be implemented by the inherited class.

Implements satnogs::comms::lib::bsp::imsgq< T >.

Definition at line 374 of file bsp.hpp.

◆ size()

template<typename T, const size_t LEN>
size_t satnogs::comms::msgq< T, LEN >::size ( )
inlinevirtual

A virtual method that returns the current number of messages in the queue.

Returns
The number of messages currently in the queue.
Note
Must be implemented by the inherited class.

Implements satnogs::comms::lib::bsp::imsgq< T >.

Definition at line 356 of file bsp.hpp.


The documentation for this class was generated from the following file: