#include <OneToMany.h>
Public Types | |
typedef edm::Ref< CVal > | data_type |
insert val type | |
typedef index | index_type |
index type | |
typedef edm::Ref< CKey > | key_type |
insert key type | |
typedef std::map< index_type, map_assoc > | map_type |
map type | |
typedef helpers::KeyVal < KeyRefProd, ValRefProd > | ref_type |
reference set type | |
typedef std::vector< const typename CKey::value_type * > | transient_key_vector |
transient key vector | |
typedef std::map< const typename CKey::value_type *, std::vector< const typename CVal::value_type * > > | transient_map_type |
transient map type | |
typedef std::vector < std::vector< const typename CVal::value_type * > > | transient_val_vector |
transient val vector | |
typedef edm::RefVector< CVal > | val_type |
values reference collection type | |
Static Public Member Functions | |
static void | insert (ref_type &ref, map_type &m, const key_type &k, const data_type &v) |
insert in the map | |
static void | insert (ref_type &ref, map_type &m, const key_type &k, const val_type &v) |
static map_type::size_type | size (const map_assoc &v) |
size of data_type | |
static void | sort (map_type &) |
sort | |
static transient_key_vector | transientKeyVector (const ref_type &ref, const map_type &map) |
fill transient key vector | |
static transient_map_type | transientMap (const ref_type &ref, const map_type &map) |
fill transient map | |
static transient_val_vector | transientValVector (const ref_type &ref, const map_type &map) |
fill transient val vector | |
static val_type | val (const ref_type &ref, const map_assoc &iv) |
return values collection | |
Private Types | |
typedef edm::RefProd< CKey > | KeyRefProd |
reference to "key" collection | |
typedef std::vector< index > | map_assoc |
internal map associated data | |
typedef edm::RefProd< CVal > | ValRefProd |
reference to "value" collection |
Definition at line 12 of file OneToMany.h.
typedef edm::Ref<CVal> edm::OneToMany< CKey, CVal, index >::data_type |
insert val type
Definition at line 25 of file OneToMany.h.
typedef index edm::OneToMany< CKey, CVal, index >::index_type |
index type
Definition at line 27 of file OneToMany.h.
typedef edm::Ref<CKey> edm::OneToMany< CKey, CVal, index >::key_type |
insert key type
Definition at line 23 of file OneToMany.h.
typedef edm::RefProd<CKey> edm::OneToMany< CKey, CVal, index >::KeyRefProd [private] |
reference to "key" collection
Definition at line 14 of file OneToMany.h.
typedef std::vector<index> edm::OneToMany< CKey, CVal, index >::map_assoc [private] |
internal map associated data
Definition at line 18 of file OneToMany.h.
typedef std::map<index_type, map_assoc > edm::OneToMany< CKey, CVal, index >::map_type |
map type
Definition at line 29 of file OneToMany.h.
typedef helpers::KeyVal<KeyRefProd, ValRefProd> edm::OneToMany< CKey, CVal, index >::ref_type |
reference set type
Definition at line 31 of file OneToMany.h.
typedef std::vector<const typename CKey::value_type *> edm::OneToMany< CKey, CVal, index >::transient_key_vector |
transient key vector
Definition at line 37 of file OneToMany.h.
typedef std::map<const typename CKey::value_type *, std::vector<const typename CVal::value_type *> > edm::OneToMany< CKey, CVal, index >::transient_map_type |
transient map type
Definition at line 35 of file OneToMany.h.
typedef std::vector<std::vector<const typename CVal::value_type *> > edm::OneToMany< CKey, CVal, index >::transient_val_vector |
transient val vector
Definition at line 39 of file OneToMany.h.
typedef edm::RefVector<CVal> edm::OneToMany< CKey, CVal, index >::val_type |
values reference collection type
Definition at line 21 of file OneToMany.h.
typedef edm::RefProd<CVal> edm::OneToMany< CKey, CVal, index >::ValRefProd [private] |
reference to "value" collection
Definition at line 16 of file OneToMany.h.
static void edm::OneToMany< CKey, CVal, index >::insert | ( | ref_type & | ref, |
map_type & | m, | ||
const key_type & | k, | ||
const data_type & | v | ||
) | [inline, static] |
insert in the map
Definition at line 41 of file OneToMany.h.
Referenced by edm::OneToMany< JetC, reco::TrackCollection >::insert().
{ if (k.isNull() || v.isNull()) Exception::throwThis(errors::InvalidReference, "can't insert null references in AssociationMap"); if (ref.key.isNull()) { ref.key = KeyRefProd(k); ref.val = ValRefProd(v); } helpers::checkRef(ref.key, k); helpers::checkRef(ref.val, v); index_type ik = index_type(k.key()), iv = index_type(v.key()); m[ ik ].push_back(iv); }
static void edm::OneToMany< CKey, CVal, index >::insert | ( | ref_type & | ref, |
map_type & | m, | ||
const key_type & | k, | ||
const val_type & | v | ||
) | [inline, static] |
static map_type::size_type edm::OneToMany< CKey, CVal, index >::size | ( | const map_assoc & | v | ) | [inline, static] |
static void edm::OneToMany< CKey, CVal, index >::sort | ( | map_type & | ) | [inline, static] |
static transient_key_vector edm::OneToMany< CKey, CVal, index >::transientKeyVector | ( | const ref_type & | ref, |
const map_type & | map | ||
) | [inline, static] |
static transient_map_type edm::OneToMany< CKey, CVal, index >::transientMap | ( | const ref_type & | ref, |
const map_type & | map | ||
) | [inline, static] |
fill transient map
Definition at line 70 of file OneToMany.h.
{ transient_map_type m; const CKey & ckey = * ref.key; const CVal & cval = * ref.val; for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i) { const map_assoc & a = i->second; const typename CKey::value_type * k = & ckey[ i->first ]; std::vector<const typename CVal::value_type *> v; for(typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j) { const typename CVal::value_type * val = & cval[ *j ]; v.push_back(val); } m.insert(std::make_pair(k, v)); } return m; }
static transient_val_vector edm::OneToMany< CKey, CVal, index >::transientValVector | ( | const ref_type & | ref, |
const map_type & | map | ||
) | [inline, static] |
fill transient val vector
Definition at line 95 of file OneToMany.h.
{ transient_val_vector m; const CVal & cval = * ref.val; for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i) { const map_assoc & a = i->second; std::vector<const typename CVal::value_type *> v; m.push_back(v); for(typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j) m.back().push_back(& cval[ *j ]); } return m; }
static val_type edm::OneToMany< CKey, CVal, index >::val | ( | const ref_type & | ref, |
const map_assoc & | iv | ||
) | [inline, static] |
return values collection
Definition at line 59 of file OneToMany.h.
Referenced by edm::OneToMany< JetC, reco::TrackCollection >::transientMap().