diff options
Diffstat (limited to 'raul/SRSWQueue.hpp')
-rw-r--r-- | raul/SRSWQueue.hpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/raul/SRSWQueue.hpp b/raul/SRSWQueue.hpp index d87b431..80758d2 100644 --- a/raul/SRSWQueue.hpp +++ b/raul/SRSWQueue.hpp @@ -26,7 +26,6 @@ namespace Raul { - /** Realtime-safe single-reader single-writer queue (aka lock-free ringbuffer) * * This is appropriate for a cross-thread queue of fixed size object. If you @@ -51,13 +50,11 @@ public: inline size_t capacity() const { return _size-1; } - // Write thread(s): inline bool full() const; inline bool push(const T& obj); - // Read thread: inline bool empty() const; @@ -71,7 +68,6 @@ private: T* const _objects; ///< Fixed array containing queued elements }; - template<typename T> SRSWQueue<T>::SRSWQueue(size_t size) : _front(0) @@ -82,14 +78,12 @@ SRSWQueue<T>::SRSWQueue(size_t size) assert(size > 1); } - template <typename T> SRSWQueue<T>::~SRSWQueue() { delete[] _objects; } - /** Return whether or not the queue is empty. */ template <typename T> @@ -99,7 +93,6 @@ SRSWQueue<T>::empty() const return (_back.get() == _front.get()); } - /** Return whether or not the queue is full. */ template <typename T> @@ -109,7 +102,6 @@ SRSWQueue<T>::full() const return (((_front.get() - _back.get() + _size) % _size) == 1); } - /** Return the element at the front of the queue without removing it */ template <typename T> @@ -119,7 +111,6 @@ SRSWQueue<T>::front() const return _objects[_front.get()]; } - /** Push an item onto the back of the SRSWQueue - realtime-safe, not thread-safe. * * @returns true if @a elem was successfully pushed onto the queue, @@ -139,7 +130,6 @@ SRSWQueue<T>::push(const T& elem) } } - /** Pop an item off the front of the queue - realtime-safe, not thread-safe. * * It is a fatal error to call pop() when the queue is empty. @@ -156,7 +146,6 @@ SRSWQueue<T>::pop() _front = (_front.get() + 1) % (_size); } - } // namespace Raul #endif // RAUL_SRSW_QUEUE_HPP |