![]() |
helics
2.8.1
|
#include <IpcBlockingPriorityQueueImpl.hpp>
Public Member Functions | |
| IpcBlockingPriorityQueueImpl (void *dataBlock, size_t blockSize) | |
| void | clear () |
| IpcBlockingPriorityQueueImpl (const IpcBlockingPriorityQueueImpl &)=delete | |
| IpcBlockingPriorityQueueImpl & | operator= (const IpcBlockingPriorityQueueImpl &)=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::detail::IpcBlockingPriorityQueueImpl::IpcBlockingPriorityQueueImpl | ( | void * | dataBlock, |
| size_t | blockSize | ||
| ) |
default constructor
|
delete |
DISABLE_COPY_AND_ASSIGN
| void helics::ipc::detail::IpcBlockingPriorityQueueImpl::clear | ( | ) |
clear the queue
| bool helics::ipc::detail::IpcBlockingPriorityQueueImpl::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::detail::IpcBlockingPriorityQueueImpl::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::detail::IpcBlockingPriorityQueueImpl::push | ( | const unsigned char * | data, |
| size_t | size | ||
| ) |
push a data block val the value to push on the queue
push an element onto the queue val the value to push on the queue
References data.
| void helics::ipc::detail::IpcBlockingPriorityQueueImpl::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::detail::IpcBlockingPriorityQueueImpl::try_peek | ( | ) | const |
try to peek at an object without popping it from the stack
only available for copy assignable objects
| bool helics::ipc::detail::IpcBlockingPriorityQueueImpl::try_pop | ( | unsigned char * | data, |
| int | maxSize | ||
| ) |
try to pop an object from the queue
| bool helics::ipc::detail::IpcBlockingPriorityQueueImpl::try_push | ( | const unsigned char * | data, |
| size_t | size | ||
| ) |
push a data block val the value to push on the queue
| bool helics::ipc::detail::IpcBlockingPriorityQueueImpl::try_pushPriority | ( | const unsigned char * | data, |
| size_t | size | ||
| ) |
push an element onto the queue val the value to push on the queue
1.8.17