BCNP 3.2.1
Batched Command Network Protocol
Loading...
Searching...
No Matches
bcnp::CommandQueue Class Reference

Legacy CommandQueue - use MessageQueue<DriveCmd> for new code. More...

#include <command_queue.h>

Inheritance diagram for bcnp::CommandQueue:
[legend]
Collaboration diagram for bcnp::CommandQueue:
[legend]

Public Member Functions

 CommandQueue (MessageQueueConfig config={})
 
void NotifyPacketReceived (Clock::time_point now)
 
std::optional< DriveCmd > ActiveCommand () const
 
void IncrementParseErrors ()
 
- Public Member Functions inherited from bcnp::MessageQueue< DriveCmd >
 MessageQueue (MessageQueueConfig config={})
 
void Clear ()
 Remove all messages from the queue.
 
bool Push (const DriveCmd &message)
 Add a message to the back of the queue.
 
std::size_t Size () const
 Get the current number of queued messages.
 
void NotifyReceived (Clock::time_point now)
 Notify that messages were received from the network.
 
void Update (Clock::time_point now)
 Update queue state - call once per control loop iteration.
 
std::optional< DriveCmd > ActiveMessage () const
 Get the currently executing message.
 
bool IsConnected (Clock::time_point now) const
 Check if the connection is still active.
 
MessageQueueMetrics GetMetrics () const
 Get current queue metrics.
 
void ResetMetrics ()
 Reset all metrics to zero.
 
void SetConfig (const MessageQueueConfig &config)
 Update queue configuration.
 
MessageQueueConfig GetConfig () const
 
Transaction BeginTransaction ()
 

Additional Inherited Members

- Public Types inherited from bcnp::MessageQueue< DriveCmd >
using Clock
 

Detailed Description

Legacy CommandQueue - use MessageQueue<DriveCmd> for new code.

Definition at line 16 of file command_queue.h.

Constructor & Destructor Documentation

◆ CommandQueue()

bcnp::CommandQueue::CommandQueue ( MessageQueueConfig config = {})
inlineexplicit

Definition at line 18 of file command_queue.h.

Member Function Documentation

◆ ActiveCommand()

std::optional< DriveCmd > bcnp::CommandQueue::ActiveCommand ( ) const
inline

Definition at line 23 of file command_queue.h.

Here is the call graph for this function:

◆ IncrementParseErrors()

void bcnp::CommandQueue::IncrementParseErrors ( )
inline

Definition at line 24 of file command_queue.h.

◆ NotifyPacketReceived()

void bcnp::CommandQueue::NotifyPacketReceived ( Clock::time_point now)
inline

Definition at line 22 of file command_queue.h.

Here is the call graph for this function:

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