| 1 | /* |
|---|
| 2 | * Hydrogen |
|---|
| 3 | * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net] |
|---|
| 4 | * |
|---|
| 5 | * http://www.hydrogen-music.org |
|---|
| 6 | * |
|---|
| 7 | * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | * it under the terms of the GNU General Public License as published by |
|---|
| 9 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | * (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This program is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY, without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | * GNU General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU General Public License |
|---|
| 18 | * along with this program; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 | * |
|---|
| 21 | */ |
|---|
| 22 | #ifndef H2CORE_SEQSCRIPTITERATOR_H |
|---|
| 23 | #define H2CORE_SEQSCRIPTITERATOR_H |
|---|
| 24 | |
|---|
| 25 | #include "SeqEvent.h" |
|---|
| 26 | |
|---|
| 27 | namespace H2Core |
|---|
| 28 | { |
|---|
| 29 | class SeqScript; |
|---|
| 30 | |
|---|
| 31 | template <typename _Event, typename _Script> |
|---|
| 32 | class _SeqScriptIterator |
|---|
| 33 | { |
|---|
| 34 | public: |
|---|
| 35 | typedef _Event value_type; |
|---|
| 36 | typedef long difference_type; |
|---|
| 37 | typedef _Event* pointer; |
|---|
| 38 | typedef _Event& reference; |
|---|
| 39 | typedef _SeqScriptIterator _Self; |
|---|
| 40 | typedef _Script _Parent; |
|---|
| 41 | |
|---|
| 42 | _SeqScriptIterator(); |
|---|
| 43 | _SeqScriptIterator(_Script* s); |
|---|
| 44 | _SeqScriptIterator(const _Self& o); |
|---|
| 45 | virtual ~_SeqScriptIterator(); |
|---|
| 46 | |
|---|
| 47 | reference operator*() const; |
|---|
| 48 | pointer operator->() const; |
|---|
| 49 | _Self& operator++(); // prefix |
|---|
| 50 | _Self operator++(int); // postfix |
|---|
| 51 | _Self& operator+=(difference_type n); |
|---|
| 52 | _Self operator+(difference_type n) const; |
|---|
| 53 | _Self& operator-=(difference_type n); |
|---|
| 54 | _Self operator-(difference_type n) const; |
|---|
| 55 | reference operator[](difference_type n) const; |
|---|
| 56 | |
|---|
| 57 | bool operator!=(const _Self& o) const; |
|---|
| 58 | |
|---|
| 59 | private: |
|---|
| 60 | _Parent* q; |
|---|
| 61 | }; |
|---|
| 62 | |
|---|
| 63 | typedef _SeqScriptIterator<SeqEvent, |
|---|
| 64 | SeqScript> SeqScriptIterator; |
|---|
| 65 | typedef _SeqScriptIterator<const SeqEvent, |
|---|
| 66 | const SeqScript> SeqScriptConstIterator; |
|---|
| 67 | |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | #endif // H2CORE_SEQSCRIPTITERATOR_H |
|---|