summaryrefslogtreecommitdiffstats
path: root/raul/List.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-24 02:07:30 +0000
committerDavid Robillard <d@drobilla.net>2008-11-24 02:07:30 +0000
commitc894b33088b9c64316b747f05abc5dd0f868f7bf (patch)
treeeafa980ab2fb856354c2a8dab062db4c51dcd505 /raul/List.hpp
parentf94295cd8431e0489c244c2e41ae4bdfb6d5e6b0 (diff)
downloadraul-c894b33088b9c64316b747f05abc5dd0f868f7bf.tar.gz
raul-c894b33088b9c64316b747f05abc5dd0f868f7bf.tar.bz2
raul-c894b33088b9c64316b747f05abc5dd0f868f7bf.zip
Use lists instead of ringbuffers for event queue - remove upper limit on event queue size and related warnings on big patch load.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@1776 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/List.hpp')
-rw-r--r--raul/List.hpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/raul/List.hpp b/raul/List.hpp
index 05fdb1e..a3f63a2 100644
--- a/raul/List.hpp
+++ b/raul/List.hpp
@@ -69,11 +69,17 @@ public:
};
- List() : _size(0), _end_iter(this), _const_end_iter(this) {
+ List(size_t size=0, Node* head=NULL, Node* tail=NULL)
+ : _size(size)
+ , _end_iter(this)
+ , _const_end_iter(this)
+ {
+ _head = head;
+ _tail = tail;
_end_iter._listnode = NULL;
_const_end_iter._listnode = NULL;
}
-
+
~List();
void push_back(Node* elem); ///< Realtime Safe
@@ -106,6 +112,9 @@ public:
inline bool operator==(const const_iterator& iter) const;
inline bool operator==(const iterator& iter) const;
+ inline typename List<T>::Node* node() { return _listnode; }
+ inline const typename List<T>::Node* node() const { return _listnode; }
+
friend class List<T>;
private:
@@ -126,7 +135,7 @@ public:
inline bool operator!=(const const_iterator& iter) const;
inline bool operator==(const iterator& iter) const;
inline bool operator==(const const_iterator& iter) const;
-
+
friend class List<T>;
friend class List<T>::const_iterator;
@@ -135,6 +144,7 @@ public:
typename List<T>::Node* _listnode;
};
+ void chop_front(List<T>& front, size_t front_size, Node* new_head);
Node* erase(const iterator iter);
@@ -147,6 +157,9 @@ public:
T& front() { return *begin(); }
const T& front() const { return *begin(); }
+ Node* head() { return _head.get(); }
+ const Node* head() const { return _head.get(); }
+
private:
AtomicPtr<Node> _head;
AtomicPtr<Node> _tail; ///< writer only
@@ -158,6 +171,7 @@ private:
} // namespace Raul
+#endif // RAUL_LIST_HPP
+
#include "ListImpl.hpp"
-#endif // RAUL_LIST_HPP