29 #if defined(IteratorCirculatorTraits_RECURSES)
30 #error Recursive header files inclusion detected in IteratorCirculatorTraits.h
31 #else // defined(IteratorCirculatorTraits_RECURSES)
33 #define IteratorCirculatorTraits_RECURSES
35 #if !defined IteratorCirculatorTraits_h
37 #define IteratorCirculatorTraits_h
42 #include<boost/iterator/iterator_categories.hpp>
43 #include<boost/iterator/iterator_facade.hpp>
75 template <
typename IC>
82 static yes&
test(
typename C::Type*);
99 template <
typename IC,
typename ICType>
106 template <
typename IC>
126 template <
typename IC,
bool flagHasNestedTypeCalledType = false>
133 template <
typename IC>
150 template <
typename IC>
168 template<
bool b = false>
189 template<
typename IC>
212 template <
typename C>
252 #if (((BOOST_VERSION /100000)==1) && ((BOOST_VERSION / 100 % 1000 )<57))
254 struct ToDGtalCategory<
boost::detail::iterator_category_with_traversal<std::input_iterator_tag,boost::forward_traversal_tag> > {
258 struct ToDGtalCategory<
boost::detail::iterator_category_with_traversal<std::input_iterator_tag,boost::bidirectional_traversal_tag> > {
259 typedef BidirectionalCategory
Category;
263 struct ToDGtalCategory<
boost::detail::iterator_category_with_traversal<std::input_iterator_tag,boost::random_access_traversal_tag> > {
264 typedef RandomAccessCategory
Category;
268 struct ToDGtalCategory<
boost::iterators::detail::iterator_category_with_traversal<std::input_iterator_tag,boost::forward_traversal_tag> > {
272 struct ToDGtalCategory<
boost::iterators::detail::iterator_category_with_traversal<std::input_iterator_tag,boost::bidirectional_traversal_tag> > {
277 struct ToDGtalCategory<
boost::iterators::detail::iterator_category_with_traversal<std::input_iterator_tag,boost::random_access_traversal_tag> > {
293 template <
typename IC>
300 <
typename boost::iterator_category<IC>::type>
::Category
303 typedef typename IC::value_type
Value;
336 #endif // !defined IteratorCirculatorTraits_h
338 #undef IteratorCirculatorTraits_RECURSES
339 #endif // else defined(IteratorCirculatorTraits_RECURSES)
Aim: Defines the Iterator or Circulator type as a nested type according to the value of b...
BOOST_STATIC_CONSTANT(bool, value=IsCirculatorHelper::value)
static yes & test(typename C::Type *)
Aim: Checks whether type IC is a circular or a classical iterator. Static value set to 'true' for a c...
Aim: Provides the type of IC as a nested type: either IteratorType or CirculatorType.
Aim: Checks whether type IC is a circular or a classical iterator. Static value set to 'true' for a c...
BidirectionalCategory Category
detail::IteratorCirculatorTypeImpl< IsCirculator< IC >::value >::Type Type
detail::IsCirculator< IC, detail::HasNestedTypeType< IC >::value > IsCirculatorHelper
Aim: Provides the DGtal category matching C {ForwardCategory,BidirectionalCategory,RandomAccessCategory}.
RandomAccessCategory Category
RandomAccessCategory Category
IsCirculatorFromType< IC, typename IC::Type > IsCirculatorHelper
Aim: Checks whether type IC has a nested type called 'Type' or not. NB: from en.wikipedia.org/wiki/Substitution_failure_is_not_an_error NB: to avoid various compiler issues, we use BOOST_STATIC_CONSTANT according to http://www.boost.org/development/int_const_guidelines.html.
ToDGtalCategory< typename boost::iterator_category< IC >::type >::Category Category
Aim: Provides nested types for both iterators and circulators: Type, Category, Value, Difference, Pointer and Reference.
BOOST_STATIC_CONSTANT(bool, value=sizeof(test< IC >(0))==sizeof(yes))
BOOST_STATIC_CONSTANT(bool, value=false)
BOOST_STATIC_CONSTANT(bool, value=false)
Aim: In order to check whether type IC is a circular or a classical iterator, the nested type called ...
DGtal is the top-level namespace which contains all DGtal functions and types.
RandomAccessCategory Category
IC::difference_type Difference
BidirectionalCategory Category
RandomAccessCategory Category
RandomAccessCategory Category
IteratorCirculatorType< IC >::Type Type
BidirectionalCategory Category