1
//--------------------------------------------------------------------------------------
2
// This file is part of the Lomse library.
3
// Copyright (c) 2010 Lomse project
5
// Lomse is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation,
7
// either version 3 of the License, or (at your option) any later version.
9
// Lomse is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along
14
// with Lomse; if not, see <http://www.gnu.org/licenses/>.
18
// For any comment, suggestion or feature request, please contact the manager of
19
// the project at cecilios@users.sourceforge.net
21
//-------------------------------------------------------------------------------------
23
#ifndef __LOMSE_SCORE_ITERATOR_H__
24
#define __LOMSE_SCORE_ITERATOR_H__
27
#include "lomse_staffobjs_table.h"
34
//forward declarations
39
//-------------------------------------------------------------------------------------
40
// ScoreIterator: A cursor to traverse the ColStaffObjs
41
//-------------------------------------------------------------------------------------
46
ColStaffObjs* m_pColStaffObjs;
47
ColStaffObjs::iterator m_it;
50
ScoreIterator(ColStaffObjs* pColStaffObjs);
53
// inline bool FirstOfCollection() {
54
// return (m_pSO && m_pSO == m_pColStaffObjs->GetFirstSO()); }
55
// inline bool LastOfCollection() {
56
// return (m_pSO && m_pSO == m_pColStaffObjs->GetLastSO()); }
57
// inline bool StartOfCollection() {
58
// return FirstOfCollection() || m_pColStaffObjs->IsEmpty(); }
59
// inline bool EndOfCollection() {
60
// return (m_pSO == (lmStaffObj*)NULL || (FirstOfCollection() && m_fEnd)); }
62
// inline bool ChangeOfMeasure() { return m_fChangeOfMeasure; }
63
//inline lmStaffObj* GetCurrent() { return m_pSO; }
64
// inline int GetNumSegment() { return (m_pSO ? m_pSO->GetSegment()->GetNumSegment()
65
// : m_pColStaffObjs->GetNumSegments()-1 ); }
66
// inline void ResetFlags() { m_fChangeOfMeasure = false; }
67
// inline bool IsManagingCollection(lmColStaffObjs* pCSO) {
68
// return pCSO == m_pColStaffObjs; }
71
// void AdvanceToMeasure(int nBar);
73
inline void operator ++() { ++m_it; }
74
inline void operator --() { --m_it; }
76
// void MoveTo(lmStaffObj* pSO);
78
inline int segment() const { return (*m_it)->segment(); }
80
ColStaffObjsEntry* operator *() const { return *m_it; }
90
#endif //__LOMSE_SCORE_ITERATOR_H__