3 This file is part of the MSP Märklin suite
4 Copyright © 2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
8 #ifndef LIBMARKLIN_BLOCKITER_H_
9 #define LIBMARKLIN_BLOCKITER_H_
18 An iterator for traversing blocks.
28 BlockIter(Block *, unsigned);
30 Block *block() const { return _block; }
31 unsigned entry() const { return _entry; }
32 TrackIter track_iter() const;
35 int get_exit(const Route *) const;
37 BlockIter next(const Route * = 0) const;
38 BlockIter reverse(const Route * = 0) const;
39 BlockIter flip() const;
41 Block &operator*() const;
42 Block *operator->() const { return _block; }
43 bool operator==(const BlockIter &) const;
44 bool operator!=(const BlockIter &other) const { return !(*this==other); }
45 operator bool() const { return _block!=0; }
48 } // namespace Marklin