Debian Codegraph @

src/index_map.cc

raw
1 /*
2 * This file is part of MUSIC.
3 * Copyright (C) 2008, 2009 INCF
4 *
5 * MUSIC is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * MUSIC is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include <limits>
19
20 #include "music/index_map.hh"
21
22 namespace MUSIC {
23
24 int Index::WILDCARD_MAX = std::numeric_limits<int>::max ();
25
26 bool operator< (const IndexInterval& a, const IndexInterval& b)
27 {
28 return (a.begin () < b.begin ()
29 || (a.begin () == b.begin () && a.end () < b.end ()));
30 }
31
32 const IndexInterval
33 IndexMap::iterator::operator* ()
34 {
35 return **implementation_;
36 }
37
38
39 const IndexInterval*
40 IndexMap::iterator::operator-> ()
41 {
42 return implementation_->dereference ();
43 }
44
45
46 bool
47 IndexMap::iterator::operator== (const iterator& i) const
48 {
49 return implementation_->isEqual (i.implementation ());
50 }
51
52
53 bool
54 IndexMap::iterator::operator!= (const iterator& i) const
55 {
56 return !implementation_->isEqual (i.implementation ());
57 }
58
59
60 IndexMap::iterator&
61 IndexMap::iterator::operator++ ()
62 {
63 ++*implementation_;
64 return *this;
65 }
66
67 }