/* * tree.h * * Created on: 28.11.2013 * Author: trifon */ #ifndef TREE_H_ #define TREE_H_ template class Tree { public: virtual T root() const = 0; virtual I iterator() const = 0; }; template class TreeIterator { public: // it++; // преместване надясно, копие // TreeIterator operator++(int) = 0; // ++it; // преместване наляво, копие // TreeIterator operator++() = 0; // if (it) { ... } else { ... } // проверка за валидност virtual operator bool() const = 0; // cout << l.getElementAt(it); // cout << *it; // *it = 3; // получаване и установяване на стойност през итератор virtual T& operator*() const = 0; // сравняване на итератори virtual bool operator==(TreeIterator const&) const = 0; bool operator!=(TreeIterator const& it) const { return !(*this == it); } }; #endif /* TREE_H_ */