1 #ifndef DataFormats_Common_AssociationMap_h
2 #define DataFormats_Common_AssociationMap_h
19 template<
typename Tag>
65 typename map_type::const_iterator
i;
92 if (
ref_.key.id() != k.
id())
return end();
108 if (
ref_.key.id() != k.
id())
return 0;
109 typename map_type::const_iterator
f =
map_.find(k.
key());
110 if (f ==
map_.end())
return 0;
118 typename Tag::transient_map_type
map() {
119 return Tag::transientMap(
ref_,
map_ );
123 typename Tag::transient_key_vector
keys() {
124 return Tag::transientKeyVector(
ref_,
map_ );
128 typename Tag::transient_val_vector
values() {
129 return Tag::transientValVector(
ref_,
map_ );
138 public std::binary_function<const self&, size_type, const value_type *> {
141 typename self::second_argument_type
i) {
142 return &(*c.find(i));
158 typename map_type::const_iterator
f = map_.find(i);
159 if (f == map_.end())
return end();
164 typename internal_transient_map_type::const_iterator tf =
transientMap_.find(i);
166 typename map_type::const_iterator
f =
map_.find(i);
170 std::pair<typename internal_transient_map_type::const_iterator, bool>
ins =
172 return ins.first->second;
180 template<
typename,
typename,
typename>
friend class OneToValue;
181 template<
typename,
typename,
typename>
friend class OneToOne;
182 template<
typename,
typename,
typename>
friend class OneToMany;
186 namespace refhelper {
187 template<
typename Tag>
ptrdiff_t difference_type
Tag::index_type index_type
index type
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
internal_transient_map_type transientMap_
transient reference map
std::map< index_type, value_type > internal_transient_map_type
transient map type
bool empty() const
return true if empty
const_iterator find(const key_type &k) const
find element with specified reference key
Tag::data_type data_type
insert data type
const value_type * operator->() const
AssociationMap(const ref_type &ref)
default constructor
helpers::KeyVal< key_type, internal_val_type > value_type
value type
Tag::transient_val_vector values()
Tag::key_type key_type
insert key type
key_type key() const
Accessor for product key.
ref_type ref_
reference set
self::value_type value_type
#define CMS_CLASS_VERSION(_version_)
value_type::value_type result_type
result type
ProductID id() const
Accessor for product ID.
size_type numberOfAssociations(const key_type &k) const
number of associations to a key
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
size_type erase(const key_type &k)
erase the element whose key is k
bool operator!=(const const_iterator &ci) const
const_iterator & operator++()
map_type::const_iterator i
const_iterator(const self *map, typename map_type::const_iterator mi)
const ref_type & refProd() const
return ref-prod structure
void post_insert()
post insert action
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Container::value_type value_type
Tag::transient_key_vector keys()
bool operator==(const const_iterator &ci) const
AssociationMap< Tag >::Find value
const_iterator operator++(int)
Tag::val_type internal_val_type
insert key type
size_type size() const
map size
void insert(const key_type &k, const data_type &v)
insert an association
const value_type * operator()(typename self::first_argument_type c, typename self::second_argument_type i)
const_iterator operator--(int)
map_type::const_iterator::iterator_category iterator_category
Tag::ref_type ref_type
reference set type
Tag::map_type map_type
map type
void insert(const value_type &kv)
AssociationMap()
default constructor
const_iterator begin() const
first iterator over the map (read only)
const result_type & operator[](const key_type &k) const
find element with specified reference key
void checkRef(const RP &rp, const R &r)
throw if r hasn't the same id as rp
tuple size
Write out results.
const_iterator & operator--()
const value_type & operator[](size_type i) const
return value_typeelement with key i
Tag::transient_map_type map()
const value_type & operator*() const
map_type::size_type size_type
size type