1 #ifndef DataFormats_Common_OneToValue_h
2 #define DataFormats_Common_OneToValue_h
11 template<
typename CKey,
typename Val,
typename index =
unsigned int>
27 typedef std::map<index_type, map_assoc>
map_type;
41 "can't insert null references in AssociationMap");
43 if(ref.
key.isNull()) {
61 CKey
const& ckey = *ref.
key;
62 for(
typename map_type::const_iterator
i = map.begin();
i != map.end(); ++
i) {
64 m.insert(std::make_pair(k,
i->second));
71 CKey
const& ckey = *ref.
key;
72 for(
typename map_type::const_iterator
i = map.begin();
i != map.end(); ++
i) {
73 m.push_back(& ckey[
i->first]);
80 for(
typename map_type::const_iterator
i = map.begin();
i != map.end(); ++
i) {
81 m.push_back(
i->second);
Val map_assoc
internal map associated data
std::map< typename CKey::value_type const *, Val > transient_map_type
transient map type
helpers::Key< KeyRefProd > ref_type
reference set type
static transient_map_type transientMap(ref_type const &ref, map_type const &map)
fill transient map
static map_type::size_type size(map_assoc const &)
size of data_type
index index_type
index type
static void sort(map_type &)
sort
Val val_type
values reference collection type
static val_type val(ref_type const &, map_assoc const &v)
return values collection
Ref< CKey > key_type
insert key type
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
std::vector< typename CKey::value_type const * > transient_key_vector
transient key vector
bool isNull() const
Checks for null.
Container::value_type value_type
Val data_type
insert val type
std::map< index_type, map_assoc > map_type
map type
key_type key() const
Accessor for product key.
RefProd< CKey > KeyRefProd
reference to "key" collection
std::vector< Val > transient_val_vector
transient val vector
static transient_key_vector transientKeyVector(ref_type const &ref, map_type const &map)
fill transient key vector
void checkRef(const RP &rp, const R &r)
throw if r hasn't the same id as rp
static void insert(ref_type &ref, map_type &m, key_type const &k, data_type const &v)
insert in the map
static transient_val_vector transientValVector(ref_type const &ref, map_type const &map)
fill transient val vector