Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
mm::comm::spoe::SpoeInputQueue Class Reference

#include <spoe_process_data.h>

Public Member Functions

void reset (std::size_t frameBytes, std::size_t capacity)
 Sizes the queue and empties it. Not safe while the producer or the consumer runs.
 
bool push (std::span< const uint8_t > frame)
 Producer side. Returns false, and drops frame, when the queue is full.
 
bool pop (std::span< uint8_t > frame)
 
std::size_t dropOldest (std::size_t keep)
 
std::size_t size () const
 

Detailed Description

A single-producer, single-consumer queue of fixed-size input frames. The exchange thread pushes and the RT thread pops.

Member Function Documentation

◆ dropOldest()

std::size_t mm::comm::spoe::SpoeInputQueue::dropOldest ( std::size_t  keep)

Consumer side. Removes the oldest frames until at most keep remain, and returns how many it removed. Keeping the queue short keeps the delay between the drive and the RT cycle short.

◆ pop()

bool mm::comm::spoe::SpoeInputQueue::pop ( std::span< uint8_t >  frame)

Consumer side. Copies the oldest frame into frame and removes it. Returns false, and leaves frame untouched, when the queue is empty.

◆ push()

bool mm::comm::spoe::SpoeInputQueue::push ( std::span< const uint8_t >  frame)

Producer side. Returns false, and drops frame, when the queue is full.

◆ reset()

void mm::comm::spoe::SpoeInputQueue::reset ( std::size_t  frameBytes,
std::size_t  capacity 
)

Sizes the queue and empties it. Not safe while the producer or the consumer runs.

◆ size()

std::size_t mm::comm::spoe::SpoeInputQueue::size ( ) const

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