| | |
| | | class LockFreeQueue |
| | | { |
| | | |
| | | template < typename ELEM_T_ > |
| | | friend class SHMQueue; |
| | | |
| | | private: |
| | | int slots; |
| | | int items; |
| | | protected: |
| | | LockFreeQueue(size_t qsize = LOCK_FREE_Q_DEFAULT_SIZE); |
| | | |
| | | public: |
| | | LockFreeQueue(size_t qsize = LOCK_FREE_Q_DEFAULT_SIZE); |
| | | |
| | | /// @brief destructor of the class. |
| | | /// Note it is not virtual since it is not expected to inherit from this |
| | | /// template |
| | | ~LockFreeQueue(); |
| | | public: |
| | | std::atomic_uint reference; |
| | | /// @brief constructor of the class |
| | | |
| | |
| | | typename Allocator, |
| | | template <typename T, typename AT> class Q_TYPE> |
| | | void * LockFreeQueue<ELEM_T, Allocator, Q_TYPE>::operator new(size_t size){ |
| | | return Allocator::malloc(size); |
| | | return Allocator::allocate(size); |
| | | } |
| | | |
| | | template < |
| | |
| | | typename Allocator, |
| | | template <typename T, typename AT> class Q_TYPE> |
| | | void LockFreeQueue<ELEM_T, Allocator, Q_TYPE>::operator delete(void *p) { |
| | | return Allocator::free(p); |
| | | return Allocator::deallocate(p); |
| | | } |
| | | |
| | | // include implementation files |