Go to the documentation of this file.00001 #ifndef OPENTISSUE_UTILITY_UTILITY_MAP_DATA_ITERATOR_H
00002 #define OPENTISSUE_UTILITY_UTILITY_MAP_DATA_ITERATOR_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <boost/iterator/transform_iterator.hpp>
00013 #include <boost/iterator/iterator_adaptor.hpp>
00014
00015 #include <cassert>
00016
00017 namespace OpenTissue
00018 {
00019 namespace utility
00020 {
00021
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 template <class map_iterator>
00059 class map_data_iterator
00060 : public boost::iterator_adaptor< map_data_iterator<map_iterator>, map_iterator, typename map_iterator::value_type::second_type >
00061 {
00062 public:
00063
00064 typedef typename map_data_iterator::iterator_adaptor_ super_t;
00065 typedef typename map_iterator::value_type pair_type;
00066 typedef typename pair_type::second_type second_type;
00067
00068 friend class boost::iterator_core_access;
00069
00070 public:
00071
00072 map_data_iterator() {}
00073
00074 explicit map_data_iterator(map_iterator x)
00075 : super_t(x) {}
00076
00077 template<class other_iterator>
00078 map_data_iterator(
00079 map_data_iterator<other_iterator> const& r
00080 , typename boost::enable_if_convertible<other_iterator, map_iterator>::type* = 0
00081 )
00082 : super_t(r.base())
00083 {}
00084
00085 private:
00086
00087 second_type & dereference() const { return this->base()->second; }
00088
00089 };
00090
00091 }
00092 }
00093
00094
00095 #endif