helics
3.5.2
|
#include <IpcBlockingPriorityQueue.hpp>
Public Member Functions | |
IpcBlockingPriorityQueue (void *dataBlock, size_t blockSize) | |
void | clear () |
IpcBlockingPriorityQueue (const IpcBlockingPriorityQueue &)=delete | |
IpcBlockingPriorityQueue & | operator= (const IpcBlockingPriorityQueue &)=delete |
void | push (const unsigned char *data, size_t size) |
void | pushPriority (const unsigned char *data, size_t size) |
bool | try_push (const unsigned char *data, size_t size) |
bool | try_pushPriority (const unsigned char *data, size_t size) |
stx::optional< std::pair< unsigned char *, int > > | try_peek () const |
bool | try_pop (unsigned char *data, int maxSize) |
int | pop (unsigned char *data, int maxSize) |
void | pop (std::chrono::milliseconds timeout, unsigned char *data, int maxSize) |
bool | empty () const |
class implementing a blocking queue with a priority channel
this class uses locks one for push and pull it can exhibit longer blocking times if the internal operations require a swap, however in high usage the two locks will reduce contention in most cases.
helics::ipc::IpcBlockingPriorityQueue::IpcBlockingPriorityQueue | ( | void * | dataBlock, |
size_t | blockSize | ||
) |
default constructor
|
delete |
DISABLE_COPY_AND_ASSIGN
void helics::ipc::IpcBlockingPriorityQueue::clear | ( | ) |
clear the queue
bool helics::ipc::IpcBlockingPriorityQueue::empty | ( | ) | const |
check whether there are any elements in the queue because this is meant for multi-process applications this may or may not have any meaning depending on the number of consumers
void helics::ipc::IpcBlockingPriorityQueue::pop | ( | std::chrono::milliseconds | timeout, |
unsigned char * | data, | ||
int | maxSize | ||
) |
blocking call to wait on an object from the stack with timeout
void helics::ipc::IpcBlockingPriorityQueue::push | ( | const unsigned char * | data, |
size_t | size | ||
) |
push a data block val the value to push on the queue
void helics::ipc::IpcBlockingPriorityQueue::pushPriority | ( | const unsigned char * | data, |
size_t | size | ||
) |
push an element onto the queue val the value to push on the queue
stx::optional<std::pair<unsigned char*, int> > helics::ipc::IpcBlockingPriorityQueue::try_peek | ( | ) | const |
try to peek at an object without popping it from the stack
only available for copy assignable objects
bool helics::ipc::IpcBlockingPriorityQueue::try_pop | ( | unsigned char * | data, |
int | maxSize | ||
) |
try to pop an object from the queue
bool helics::ipc::IpcBlockingPriorityQueue::try_push | ( | const unsigned char * | data, |
size_t | size | ||
) |
push a data block val the value to push on the queue
bool helics::ipc::IpcBlockingPriorityQueue::try_pushPriority | ( | const unsigned char * | data, |
size_t | size | ||
) |
push an element onto the queue val the value to push on the queue