CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Static Public Member Functions | Private Types
edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef > Class Template Reference

#include <OneToOneGeneric.h>

Public Types

typedef ValRef data_type
 insert val type More...
 
typedef index index_type
 index type More...
 
typedef KeyRef key_type
 insert key type More...
 
typedef std::map< index_type,
map_assoc
map_type
 map type More...
 
typedef helpers::KeyVal
< keyrefprod_type,
valrefprod_type
ref_type
 reference set type More...
 
typedef std::vector< typename
CKey::value_type const * > 
transient_key_vector
 transient key vector More...
 
typedef std::map< typename
CKey::value_type const
*, typename CVal::value_type
const * > 
transient_map_type
 transient map type More...
 
typedef std::vector< typename
CVal::value_type const * > 
transient_val_vector
 transient val vector More...
 
typedef ValRef val_type
 values reference collection type More...
 

Static Public Member Functions

static void insert (ref_type &ref, map_type &m, key_type const &k, data_type const &v)
 insert in the map More...
 
static map_type::size_type size (map_assoc const &)
 size of data_type More...
 
static void sort (map_type &)
 sort More...
 
static transient_key_vector transientKeyVector (ref_type const &ref, map_type const &map)
 fill transient key vector More...
 
static transient_map_type transientMap (ref_type const &ref, map_type const &map)
 fill transient map More...
 
static transient_val_vector transientValVector (ref_type const &ref, map_type const &map)
 fill transient val vector More...
 
static val_type val (ref_type const &ref, map_assoc iv)
 return values collection More...
 

Private Types

typedef KeyRefProd keyrefprod_type
 reference to "key" collection More...
 
typedef index map_assoc
 internal map associated data More...
 
typedef ValRefProd valrefprod_type
 reference to "value" collection More...
 

Detailed Description

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
class edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >

Definition at line 17 of file OneToOneGeneric.h.

Member Typedef Documentation

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef ValRef edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::data_type

insert val type

Definition at line 31 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef index edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::index_type

index type

Definition at line 33 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef KeyRef edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::key_type

insert key type

Definition at line 29 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef KeyRefProd edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::keyrefprod_type
private

reference to "key" collection

Definition at line 19 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef index edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::map_assoc
private

internal map associated data

Definition at line 23 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::map<index_type, map_assoc> edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::map_type

map type

Definition at line 35 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef helpers::KeyVal<keyrefprod_type, valrefprod_type> edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::ref_type

reference set type

Definition at line 37 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::vector<typename CKey::value_type const*> edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_key_vector

transient key vector

Definition at line 41 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::map<typename CKey::value_type const*, typename CVal::value_type const*> edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_map_type

transient map type

Definition at line 39 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::vector<typename CVal::value_type const*> edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_val_vector

transient val vector

Definition at line 43 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef ValRef edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::val_type

values reference collection type

Definition at line 27 of file OneToOneGeneric.h.

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef ValRefProd edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::valrefprod_type
private

reference to "value" collection

Definition at line 21 of file OneToOneGeneric.h.

Member Function Documentation

template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static void edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::insert ( ref_type ref,
map_type m,
key_type const &  k,
data_type const &  v 
)
inlinestatic

insert in the map

Definition at line 45 of file OneToOneGeneric.h.

Referenced by BeautifulSoup.PageElement::_invert(), and SequenceTypes.Schedule::_replaceIfHeldDirectly().

45  {
46  if (k.isNull() || v.isNull()) {
47  Exception::throwThis(errors::InvalidReference, "can't insert null references in AssociationMap");
48  }
49  if (ref.key.isNull()) {
50  if (k.isTransient() || v.isTransient()) {
52  "can't insert transient references in uninitialized AssociationMap");
53  }
54  //another thread might change the value of productGetter()
55  auto getter = ref.key.productGetter();
56  if (getter == nullptr) {
58  "Can't insert into AssociationMap unless it was properly initialized.\n"
59  "The most common fix for this is to add arguments to the call to the\n"
60  "AssociationMap constructor that are valid Handle's to the containers.\n"
61  "If you don't have valid handles or either template parameter to the\n"
62  "AssociationMap is a View, then see the comments in AssociationMap.h.\n"
63  "(note this was a new requirement added in the 7_5_X release series)\n");
64  }
65  ref.key = KeyRefProd(k.id(), getter);
66  ref.val = ValRefProd(v.id(), ref.val.productGetter());
67  }
68  helpers::checkRef(ref.key, k);
69  helpers::checkRef(ref.val, v);
70  index_type ik = index_type(k.key()), iv = index_type(v.key());
71  m[ik] = iv;
72  }
int32_t *__restrict__ iv
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
index index_type
index type
void checkRef(const RP &rp, const R &r)
throw if r hasn&#39;t the same id as rp
template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static map_type::size_type edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::size ( map_assoc const &  )
inlinestatic

size of data_type

Definition at line 76 of file OneToOneGeneric.h.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

76 { return 1; }
template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static void edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::sort ( map_type )
inlinestatic

sort

Definition at line 78 of file OneToOneGeneric.h.

78 {}
template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static transient_key_vector edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientKeyVector ( ref_type const &  ref,
map_type const &  map 
)
inlinestatic

fill transient key vector

Definition at line 94 of file OneToOneGeneric.h.

94  {
96  if (!map.empty()) {
97  CKey const& ckey = *ref.key;
98  for (typename map_type::const_iterator i = map.begin(); i != map.end(); ++i)
99  m.push_back(&ckey[i->first]);
100  }
101  return m;
102  }
std::vector< typename CKey::value_type const * > transient_key_vector
transient key vector
template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static transient_map_type edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientMap ( ref_type const &  ref,
map_type const &  map 
)
inlinestatic

fill transient map

Definition at line 80 of file OneToOneGeneric.h.

80  {
82  if (!map.empty()) {
83  CKey const& ckey = *ref.key;
84  CVal const& cval = *ref.val;
85  for (typename map_type::const_iterator i = map.begin(); i != map.end(); ++i) {
86  typename CKey::value_type const* k = &ckey[i->first];
87  typename CVal::value_type const* v = &cval[i->second];
88  m.insert(std::make_pair(k, v));
89  }
90  }
91  return m;
92  }
std::map< typename CKey::value_type const *, typename CVal::value_type const * > transient_map_type
transient map type
template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static transient_val_vector edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientValVector ( ref_type const &  ref,
map_type const &  map 
)
inlinestatic

fill transient val vector

Definition at line 104 of file OneToOneGeneric.h.

104  {
106  if (!map.empty()) {
107  CVal const& cval = *ref.val;
108  for (typename map_type::const_iterator i = map.begin(); i != map.end(); ++i) {
109  m.push_back(&cval[i->second]);
110  }
111  }
112  return m;
113  }
std::vector< typename CVal::value_type const * > transient_val_vector
transient val vector
template<typename CKey, typename CVal, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static val_type edm::OneToOneGeneric< CKey, CVal, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::val ( ref_type const &  ref,
map_assoc  iv 
)
inlinestatic

return values collection

Definition at line 74 of file OneToOneGeneric.h.

74 { return val_type(ref.val, iv); }
int32_t *__restrict__ iv
ValRef val_type
values reference collection type