Ensō 0.4.5
Software API reference
Loading...
Searching...
No Matches
enso::RxPipe::MessageBatch< T > Class Template Reference

A class that represents a batch of messages. More...

#include <pipe.h>

Public Member Functions

constexpr MessageBatch ()
 Instantiates an empty message batch.
 
 MessageBatch (const MessageBatch &)=default
 
 MessageBatch (MessageBatch &&)=default
 
MessageBatchoperator= (const MessageBatch &)=default
 
MessageBatchoperator= (MessageBatch &&)=default
 
constexpr T begin ()
 
constexpr T begin () const
 
constexpr T end ()
 
constexpr T end () const
 
uint32_t processed_bytes () const
 Number of bytes processed by the iterator.
 
void NotifyProcessedBytes (uint32_t nb_bytes)
 Notifies the batch that a given number of bytes have been processed.
 
uint32_t available_bytes () const
 Returns number of bytes available in the batch.
 
int32_t message_limit () const
 Returns maximum number of messages in the batch.
 
uint8_t * buf () const
 Returns a pointer to the start of the batch.
 

Friends

class RxPipe
 

Detailed Description

template<typename T>
class enso::RxPipe::MessageBatch< T >

A class that represents a batch of messages.

Parameters
TAn iterator for the particular message type. Refer to enso::PktIterator for an example of a raw packet iterator.

Definition at line 398 of file pipe.h.

Constructor & Destructor Documentation

◆ MessageBatch()

template<typename T >
constexpr enso::RxPipe::MessageBatch< T >::MessageBatch ( )
inlineconstexpr

Instantiates an empty message batch.

Definition at line 403 of file pipe.h.

Member Function Documentation

◆ available_bytes()

template<typename T >
uint32_t enso::RxPipe::MessageBatch< T >::available_bytes ( ) const
inline

Returns number of bytes available in the batch.

Note
It may include more messages than message_limit(), in which case, iterating over the batch will result in fewer bytes than available_bytes(). After iterating over the batch, the total number of bytes iterated over can be obtained by calling processed_bytes().
Returns
The number of bytes available in the batch.

Definition at line 446 of file pipe.h.

◆ begin() [1/2]

template<typename T >
constexpr T enso::RxPipe::MessageBatch< T >::begin ( )
inlineconstexpr

Definition at line 411 of file pipe.h.

◆ begin() [2/2]

template<typename T >
constexpr T enso::RxPipe::MessageBatch< T >::begin ( ) const
inlineconstexpr

Definition at line 412 of file pipe.h.

◆ buf()

template<typename T >
uint8_t * enso::RxPipe::MessageBatch< T >::buf ( ) const
inline

Returns a pointer to the start of the batch.

Returns
A pointer to the start of the batch.

Definition at line 460 of file pipe.h.

◆ end() [1/2]

template<typename T >
constexpr T enso::RxPipe::MessageBatch< T >::end ( )
inlineconstexpr

Definition at line 414 of file pipe.h.

◆ end() [2/2]

template<typename T >
constexpr T enso::RxPipe::MessageBatch< T >::end ( ) const
inlineconstexpr

Definition at line 417 of file pipe.h.

◆ message_limit()

template<typename T >
int32_t enso::RxPipe::MessageBatch< T >::message_limit ( ) const
inline

Returns maximum number of messages in the batch.

Returns
The maximum number of messages in the batch.

Definition at line 453 of file pipe.h.

◆ NotifyProcessedBytes()

template<typename T >
void enso::RxPipe::MessageBatch< T >::NotifyProcessedBytes ( uint32_t  nb_bytes)
inline

Notifies the batch that a given number of bytes have been processed.

Parameters
nb_bytesThe number of bytes processed.

Definition at line 432 of file pipe.h.

◆ processed_bytes()

template<typename T >
uint32_t enso::RxPipe::MessageBatch< T >::processed_bytes ( ) const
inline

Number of bytes processed by the iterator.

Definition at line 424 of file pipe.h.

Friends And Related Function Documentation

◆ RxPipe

template<typename T >
friend class RxPipe
friend

Definition at line 478 of file pipe.h.


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