summaryrefslogtreecommitdiffstats
path: root/raul/SRMWQueue.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'raul/SRMWQueue.hpp')
-rw-r--r--raul/SRMWQueue.hpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/raul/SRMWQueue.hpp b/raul/SRMWQueue.hpp
index b1d5ff2..6680103 100644
--- a/raul/SRMWQueue.hpp
+++ b/raul/SRMWQueue.hpp
@@ -28,7 +28,6 @@
namespace Raul {
-
/** Realtime-safe single-reader multi-writer queue (aka lock-free ringbuffer)
*
* Implemented as a dequeue in a fixed array. Both push and pop are realtime
@@ -57,18 +56,15 @@ public:
explicit SRMWQueue(size_t size);
~SRMWQueue();
-
// Any thread:
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;
@@ -89,7 +85,6 @@ private:
AtomicInt* const _valid; ///< Parallel array to _objects, whether loc is written or not
};
-
template<typename T>
SRMWQueue<T>::SRMWQueue(size_t size)
: _front(0)
@@ -108,14 +103,12 @@ SRMWQueue<T>::SRMWQueue(size_t size)
}
}
-
template <typename T>
SRMWQueue<T>::~SRMWQueue()
{
free(_objects);
}
-
/** Return whether the queue is full.
*
* Write thread(s) only.
@@ -127,7 +120,6 @@ SRMWQueue<T>::full() const
return (_write_space.get() <= 0);
}
-
/** Push an item onto the back of the SRMWQueue - realtime-safe, not thread-safe.
*
* Write thread(s) only.
@@ -169,7 +161,6 @@ SRMWQueue<T>::push(const T& elem)
}
}
-
/** Return whether the queue is empty.
*
* Read thread only.
@@ -181,7 +172,6 @@ SRMWQueue<T>::empty() const
return (_valid[_front].get() == 0);
}
-
/** Return the element at the front of the queue without removing it.
*
* It is a fatal error to call front() when the queue is empty.
@@ -194,7 +184,6 @@ SRMWQueue<T>::front() const
return _objects[_front];
}
-
/** Pop an item off the front of the queue - realtime-safe, NOT thread-safe.
*
* It is a fatal error to call pop() if the queue is empty.
@@ -217,7 +206,6 @@ SRMWQueue<T>::pop()
++_write_space;
}
-
} // namespace Raul
#endif // RAUL_SRMW_QUEUE_HPP