| helics 3.6.1

Public Member Functions | List of all members
helics::ipc::detail::IpcBlockingPriorityQueueImpl Class Reference

`#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

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ IpcBlockingPriorityQueueImpl() [1/2]

helics::ipc::detail::IpcBlockingPriorityQueueImpl::IpcBlockingPriorityQueueImpl | ( | void * | dataBlock,
|  | size_t | blockSize
| ) |  |

default constructor

## ◆ IpcBlockingPriorityQueueImpl() [2/2]

helics::ipc::detail::IpcBlockingPriorityQueueImpl::IpcBlockingPriorityQueueImpl | ( | const IpcBlockingPriorityQueueImpl & |  | ) |
| delete

DISABLE_COPY_AND_ASSIGN

## Member Function Documentation

## ◆ clear()

void helics::ipc::detail::IpcBlockingPriorityQueueImpl::clear | ( |  | ) |

clear the queue

## ◆ empty()

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

## ◆ pop()

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

## ◆ push()

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

## ◆ pushPriority()

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

## ◆ try_peek()

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

Returns
  an optional object with an object of type T if available

## ◆ try_pop()

bool helics::ipc::detail::IpcBlockingPriorityQueueImpl::try_pop | ( | unsigned char * | data,
|  | int | maxSize
| ) |  |

try to pop an object from the queue

Returns
  an optional containing the value if successful the optional will be empty if there is no element in the queue

## ◆ try_push()

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

## ◆ try_pushPriority()

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

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

- IpcBlockingPriorityQueueImpl.hpp
- IpcBlockingPriorityQueueImpl.cpp