|
|
Go to the documentation of this file. 1 #ifndef DataFormats_Common_RangeMap_h
2 #define DataFormats_Common_RangeMap_h
46 typedef std::pair<unsigned int, unsigned int>
pairType;
50 typedef std::pair<const_iterator, const_iterator>
range;
54 template <
typename CMP>
74 template <
typename CMP>
76 std::pair<typename mapType::const_iterator, typename mapType::const_iterator>
r =
77 std::equal_range(
map_.begin(),
map_.end(),
id, comp<CMP>(comparator));
79 if ((
r.first) ==
map_.end()) {
85 if ((
r.second) ==
map_.end()) {
93 template <
typename CMP>
95 return get(
p.first,
p.second);
100 typename mapType::const_iterator
i =
map_.find(
id);
101 if (
i !=
map_.end()) {
110 template <
typename CI>
112 typename mapType::const_iterator
i =
map_.find(
id);
113 if (
i !=
map_.end()) {
168 for (
typename mapType::iterator it =
map_.begin(), itEnd =
map_.end(); it != itEnd; it++) {
171 unsigned int begIt = static_cast<unsigned int>(
tmp.size());
174 unsigned int endIt = static_cast<unsigned int>(
tmp.size());
175 it->second =
pairType(begIt, endIt);
182 id_iterator
id_end()
const {
return id_iterator(
map_.end()); }
186 std::vector<ID>
ids()
const {
216 template <
typename ID,
typename C,
typename P>
224 template <
typename ID,
typename C,
typename P>
mapType::const_iterator::iterator_category iterator_category
bool operator()(ID id, const typename mapType::value_type &p)
id_iterator id_end() const
last identifier iterator
void post_insert()
perfor post insert action
C collection_
stored collection
size_t id_size() const
number of contained identifiers
range get(ID id) const
get a range of objects with specified identifier
bool operator!=(const id_iterator &ci) const
RangeMap()
default constructor
C::const_iterator begin() const
first collection iterator
U second(std::pair< T, U > const &p)
void put(ID id, CI begin, CI end)
insert an object range with specified identifier
id_iterator operator--(int)
size_t size() const
return number of contained object
bool operator==(const id_iterator &ci) const
id_iterator & operator++()
range get(std::pair< ID, CMP > p) const
get range of objects matching a specified identifier with a specified comparator.
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
std::vector< ID > ids() const
indentifier vector
bool operator()(const typename mapType::value_type &p, ID id)
range get(ID id, CMP comparator) const
#define CMS_CLASS_VERSION(_version_)
void swap(RangeMap< ID, C, P > &other)
swap member function
C::pointer pointer
pointer type
std::map< ID, pairType > mapType
map of identifier to index range
ptrdiff_t difference_type
mapType map_
identifier map
C::const_iterator end() const
last collection iterator
C::const_iterator const_iterator
constant access iterator type
id_iterator(const_iterator o)
Container::value_type value_type
def template(fileName, svg, replaceme="REPLACEME")
id_iterator & operator--()
C::value_type value_type
contained object type
mapType::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
iterator range
C::reference reference
reference type
id_iterator id_begin() const
first identifier iterator
std::pair< unsigned int, unsigned int > pairType
index range
const ID operator*() const
id_iterator operator++(int)
std::pair< OmniClusterRef, TrackingParticleRef > P
RangeMap & operator=(RangeMap const &rhs)
copy assignment
C::size_type size_type
collection size type
reference operator[](size_type i)
direct access to an object in the collection