|
|
Go to the documentation of this file. 1 #ifndef DataFormats_Common_AssociationMap_h
2 #define DataFormats_Common_AssociationMap_h
41 #include "tbb/concurrent_unordered_map.h"
47 template <
typename Tag>
109 typename map_type::const_iterator
i;
153 template <
typename... Args>
174 if (
ref_.key.id() !=
k.id())
176 return find(
k.key());
182 return map_.erase(
i);
190 template <
typename K>
198 if (
ref_.key.id() !=
k.id())
200 typename map_type::const_iterator
f =
map_.find(
k.key());
206 template <
typename K>
208 if (
ref_.key.id() !=
k.id())
210 typename map_type::const_iterator
f =
map_.find(
k.key());
221 typename Tag::transient_map_type
map() {
return Tag::transientMap(
ref_,
map_); }
224 typename Tag::transient_key_vector
keys() {
return Tag::transientKeyVector(
ref_,
map_); }
227 typename Tag::transient_val_vector
values() {
return Tag::transientValVector(
ref_,
map_); }
254 typename map_type::const_iterator
f =
map_.find(
i);
261 typename internal_transient_map_type::const_iterator tf =
transientMap_.find(
i);
263 typename map_type::const_iterator
f =
map_.find(
i);
267 std::pair<typename internal_transient_map_type::const_iterator, bool>
ins =
269 return ins.first->second;
277 template <
typename,
typename,
typename>
279 template <
typename,
typename,
typename>
281 template <
typename,
typename,
typename>
283 template <
typename,
typename,
typename,
typename>
287 namespace refhelper {
288 template <
typename Tag>
AssociationMap(Args... args)
bool operator!=(const const_iterator &ci) const
size_type erase(const key_type &k)
erase the element whose key is k
const_iterator find(const key_type &k) const
find element with specified reference key
AssociationMap(const ref_type &ref)
void insert(const value_type &kv)
Tag::map_type map_type
map type
ref_type ref_
reference set
self::value_type value_type
AssociationMap< Tag >::Find value
Tag::ref_type ref_type
Holds the RefProd or RefToBaseProd of 1 or 2 collections.
const_iterator end() const
last iterator over the map (read only)
void post_insert()
post insert action
bool operator==(const const_iterator &ci) const
const_iterator & operator++()
Tag::data_type data_type
insert data type
Tag::transient_val_vector values()
const ref_type & refProd() const
return ref-prod structure
Tag::index_type index_type
index type
value_type::value_type result_type
type return by operator[]
void checkRef(const RP &rp, const R &r)
throw if r hasn't the same id as rp
const value_type & get(size_type i) const
return value_typeelement with key i
#define CMS_CLASS_VERSION(_version_)
const result_type operator()(first_argument_type c, second_argument_type i)
AssociationMap(EDProductGetter const *getter)
const_iterator(const self *map, typename map_type::const_iterator mi)
map_type::const_iterator i
friend struct const_iterator
size_type numberOfAssociations(const K &k) const
tbb::concurrent_unordered_map< index_type, value_type > internal_transient_map_type
transient map type
size_type size() const
map size
Container::value_type value_type
const result_type & operator[](const key_type &k) const
find element with specified reference key
internal_transient_map_type transientMap_
transient reference map
const_iterator operator++(int)
Tag::val_type internal_val_type
void insert(const key_type &k, const data_type &v)
insert an association
bool empty() const
return true if empty
const result_type & operator[](const K &k) const
const_iterator operator--(int)
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
const_iterator begin() const
first iterator over the map (read only)
Tag::transient_map_type map()
const value_type * operator->() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Tag::key_type key_type
insert key type
map_type::const_iterator::iterator_category iterator_category
map_type::size_type size_type
size type
size_type second_argument_type
Tag::transient_key_vector keys()
helpers::KeyVal< key_type, internal_val_type > value_type
type returned by dereferenced iterator, also can be inserted
const value_type & operator*() const
size_type numberOfAssociations(const key_type &k) const
number of associations to a key
const_iterator & operator--()
AssociationMap()
default constructor
ptrdiff_t difference_type