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