|
Tramway SDK v0.1.1
|
Simple queue implementation. More...
#include <queue.h>
Public Member Functions | |
| Queue ()=delete | |
| Queue (const Queue &)=delete | |
| Queue (Queue &&)=delete | |
| Queue (const char *name, size_t count) | |
| template<typename... Args> | |
| void | push (Args &&... args) |
| Thread safe. More... | |
| void | pop () |
| T & | front () |
| T & | back () |
| bool | try_pop (T &value) |
| Thread safe. More... | |
| size_t | size () |
| void | lock () |
| void | unlock () |
Protected Attributes | |
| const char * | name |
| size_t | csize |
| size_t | count |
| T * | first |
| T * | last |
| T * | memory_start |
| T * | memory_end |
| std::atomic< bool > | spinlock = {false} |
Simple queue implementation.
This queue uses a circular buffer internally. The push() and try_pop() methods have locks on them, so they can be used to create queues for passing messages between threads. I have no idea how multithreading works, use at your own risk.
|
delete |
|
delete |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Thread safe.
|
inline |
|
inline |
Thread safe.
Copies front of the queue into value.
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |