mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-20 10:25:43 +00:00
Allocate submixes and voices using boo::ObjToken
This commit is contained in:
@@ -7,27 +7,27 @@
|
||||
namespace boo
|
||||
{
|
||||
|
||||
/** Linked-list iterator shareable by data container types */
|
||||
template<class T>
|
||||
class DataIterator : public std::iterator<std::bidirectional_iterator_tag, T>
|
||||
/** Linked-list iterator shareable by ListNode types. */
|
||||
template <class T>
|
||||
class ListIterator : public std::iterator<std::bidirectional_iterator_tag, T>
|
||||
{
|
||||
T* m_node;
|
||||
public:
|
||||
explicit DataIterator(T* node) : m_node(node) {}
|
||||
explicit ListIterator(T* node) : m_node(node) {}
|
||||
T& operator*() const { return *m_node; }
|
||||
bool operator!=(const DataIterator& other) const { return m_node != other.m_node; }
|
||||
DataIterator& operator++() { m_node = m_node->m_next; return *this; }
|
||||
DataIterator& operator--() { m_node = m_node->m_prev; return *this; }
|
||||
bool operator!=(const ListIterator& other) const { return m_node != other.m_node; }
|
||||
ListIterator& operator++() { m_node = m_node->m_next; return *this; }
|
||||
ListIterator& operator--() { m_node = m_node->m_prev; return *this; }
|
||||
};
|
||||
|
||||
/** Linked-list IObj node made part of objects participating in list
|
||||
/** Linked-list IObj node made part of objects participating in list.
|
||||
* Subclasses must implement static methods _getHeadPtr() and _getHeadLock()
|
||||
* to support the common list-management functionality.
|
||||
*/
|
||||
template <class N, class H, class P = IObj>
|
||||
struct ListNode : P
|
||||
{
|
||||
using iterator = DataIterator<N>;
|
||||
using iterator = ListIterator<N>;
|
||||
iterator begin() { return iterator(static_cast<N*>(this)); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user