/* * SelectiveConstIterator.hpp * * Created on: Mar 19, 2013 * Author: heber */ #ifndef SELECTIVECONSTITERATOR_HPP_ #define SELECTIVECONSTITERATOR_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include template class SelectiveConstIterator : public std::iterator::difference_type, typename std::iterator_traits::value_type, typename std::iterator_traits::pointer, typename std::iterator_traits::reference> { public: typedef typename _Container::const_iterator Iter; typedef _Target Target; typedef typename Iter::value_type value_type; typedef typename Iter::difference_type difference_type; typedef typename Iter::pointer pointer; typedef typename Iter::reference reference; typedef typename Iter::iterator_category iterator_category; SelectiveConstIterator(_Descriptor, const _Container&); SelectiveConstIterator(_Descriptor, const _Container&, Iter); SelectiveConstIterator(const SelectiveConstIterator&); SelectiveConstIterator& operator=(const SelectiveConstIterator&); SelectiveConstIterator& operator++(); // prefix SelectiveConstIterator operator++(int); // postfix with dummy parameter bool operator==(const SelectiveConstIterator&); bool operator!=(const SelectiveConstIterator&); Target const operator*(); int getCount(); protected: void advanceState(); Iter state; typename _Descriptor::impl_ptr descr; int index; const _Container &content; }; #endif /* SELECTIVECONSTITERATOR_HPP_ */