| | |
| | | |
| | | void force_destroy(); |
| | | |
| | | inline uint32_t size(); |
| | | uint32_t size(); |
| | | |
| | | inline bool full(); |
| | | inline bool empty(); |
| | | bool full(); |
| | | bool empty(); |
| | | |
| | | inline int push(const ELEM_T &a_data); |
| | | inline int push_nowait(const ELEM_T &a_data); |
| | | inline int push_timeout(const ELEM_T &a_data, const struct timespec *timeout); |
| | | inline int pop(ELEM_T &a_data); |
| | | inline int pop_nowait(ELEM_T &a_data); |
| | | inline int pop_timeout(ELEM_T &a_data, struct timespec *timeout); |
| | | int push(const ELEM_T &a_data); |
| | | int push_nowait(const ELEM_T &a_data); |
| | | int push_timeout(const ELEM_T &a_data, const struct timespec *timeout); |
| | | int pop(ELEM_T &a_data); |
| | | int pop_nowait(ELEM_T &a_data); |
| | | int pop_timeout(ELEM_T &a_data, struct timespec *timeout); |
| | | |
| | | inline ELEM_T &operator[](unsigned i); |
| | | ELEM_T &operator[](unsigned i); |
| | | |
| | | // @deprecate |
| | | static size_t remove_queues_exclude(int keys[], size_t length); |
| | |
| | | |
| | | } |
| | | |
| | | template <typename ELEM_T> inline uint32_t SHMQueue<ELEM_T>::size() { |
| | | template <typename ELEM_T> uint32_t SHMQueue<ELEM_T>::size() { |
| | | return queue->size(); |
| | | } |
| | | |
| | | template <typename ELEM_T> inline bool SHMQueue<ELEM_T>::full() { |
| | | template <typename ELEM_T> bool SHMQueue<ELEM_T>::full() { |
| | | return queue->full(); |
| | | } |
| | | |
| | | template <typename ELEM_T> inline bool SHMQueue<ELEM_T>::empty() { |
| | | template <typename ELEM_T> bool SHMQueue<ELEM_T>::empty() { |
| | | return queue->empty(); |
| | | } |
| | | |
| | | template <typename ELEM_T> |
| | | inline int SHMQueue<ELEM_T>::push(const ELEM_T &a_data) { |
| | | int SHMQueue<ELEM_T>::push(const ELEM_T &a_data) { |
| | | int rv = queue->push(a_data); |
| | | if(rv == -1) { |
| | | return errno; |
| | |
| | | } |
| | | |
| | | template <typename ELEM_T> |
| | | inline int SHMQueue<ELEM_T>::push_nowait(const ELEM_T &a_data) { |
| | | int SHMQueue<ELEM_T>::push_nowait(const ELEM_T &a_data) { |
| | | int rv = queue->push(a_data, NULL, BUS_NOWAIT_FLAG); |
| | | if(rv == -1) { |
| | | if (errno == EAGAIN) |
| | |
| | | } |
| | | |
| | | template <typename ELEM_T> |
| | | inline int SHMQueue<ELEM_T>::push_timeout(const ELEM_T &a_data, const struct timespec *timeout) { |
| | | int SHMQueue<ELEM_T>::push_timeout(const ELEM_T &a_data, const struct timespec *timeout) { |
| | | |
| | | int rv = queue->push(a_data, timeout, BUS_TIMEOUT_FLAG); |
| | | if(rv == -1) { |
| | |
| | | return 0; |
| | | } |
| | | |
| | | template <typename ELEM_T> inline int SHMQueue<ELEM_T>::pop(ELEM_T &a_data) { |
| | | // printf("SHMQueue pop before\n"); |
| | | template <typename ELEM_T> |
| | | int SHMQueue<ELEM_T>::pop(ELEM_T &a_data) { |
| | | LoggerFactory::getLogger()->debug("SHMQueue pop before\n"); |
| | | int rv = queue->pop(a_data); |
| | | // printf("SHMQueue after before\n"); |
| | | |
| | | LoggerFactory::getLogger()->debug("SHMQueue pop before\n"); |
| | | if(rv == -1) { |
| | | |
| | | return errno; |
| | | } else { |
| | | return 0; |
| | |
| | | } |
| | | |
| | | template <typename ELEM_T> |
| | | inline int SHMQueue<ELEM_T>::pop_nowait(ELEM_T &a_data) { |
| | | int SHMQueue<ELEM_T>::pop_nowait(ELEM_T &a_data) { |
| | | int rv = queue->pop(a_data, NULL, BUS_NOWAIT_FLAG); |
| | | |
| | | if(rv == -1) { |
| | |
| | | } |
| | | |
| | | template <typename ELEM_T> |
| | | inline int SHMQueue<ELEM_T>::pop_timeout(ELEM_T &a_data, struct timespec *timeout) { |
| | | int SHMQueue<ELEM_T>::pop_timeout(ELEM_T &a_data, struct timespec *timeout) { |
| | | |
| | | int rv; |
| | | rv = queue->pop(a_data, timeout, BUS_TIMEOUT_FLAG); |
| | |
| | | } |
| | | |
| | | template <typename ELEM_T> |
| | | inline ELEM_T &SHMQueue<ELEM_T>::operator[](unsigned i) { |
| | | ELEM_T &SHMQueue<ELEM_T>::operator[](unsigned i) { |
| | | return queue->operator[](i); |
| | | } |
| | | |