ATLAS Offline Software
Loading...
Searching...
No Matches
CaloConstIteratorAdaptor.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
4 */
5// $Id$
12
13
14#ifndef CALODETDESCR_CALOCONSTITERATORADAPTOR_H
15#define CALODETDESCR_CALOCONSTITERATORADAPTOR_H
16
17
18#include "boost/iterator/iterator_adaptor.hpp"
19#include <iterator>
20#include <type_traits>
21
22
23// Helper: The value type of ITERATOR should be a pointer.
24// Give the type as a const pointer.
25template <class ITERATOR>
27{
28 typedef typename std::iterator_traits<ITERATOR>::value_type orig_t;
29 typedef typename std::remove_pointer<orig_t>::type base_t;
30 typedef const base_t* type;
31};
32
33
40template <class ITERATOR>
42 : public boost::iterator_adaptor<CaloConstIteratorAdaptor<ITERATOR>,
43 ITERATOR,
44 typename CaloClassIteratorValueType<ITERATOR>::type,
45 typename ITERATOR::iterator_category,
46 typename CaloClassIteratorValueType<ITERATOR>::type>
47{
48public:
51 : CaloConstIteratorAdaptor::iterator_adaptor_ (it) {}
52
53private:
54 friend class boost::iterator_core_access;
55};
56
57
58#endif // not CALODETDESCR_CALOCONSTITERATORADAPTOR_H
std::remove_pointer< orig_t >::type base_t
std::iterator_traits< ITERATOR >::value_type orig_t