PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
PixelBullet::CommandQueue Class Reference

A simple thread-safe command queue. More...

#include <CommandQueue.hpp>

Public Member Functions

void Push (const std::function< void()> &command)
 Push a new command into the queue.
 
bool Pop (std::function< void()> &command, std::chrono::milliseconds waitDuration)
 
void NotifyAll ()
 Notifies all waiting threads.
 

Detailed Description

A simple thread-safe command queue.

Member Function Documentation

◆ NotifyAll()

void PixelBullet::CommandQueue::NotifyAll ( )
inline

Notifies all waiting threads.

◆ Pop()

bool PixelBullet::CommandQueue::Pop ( std::function< void()> & command,
std::chrono::milliseconds waitDuration )
inline

Attempts to pop a command, waiting up to waitDuration. Returns true if a command was popped.

◆ Push()

void PixelBullet::CommandQueue::Push ( const std::function< void()> & command)
inline

Push a new command into the queue.


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