CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::RefVectorBase< KEY > Class Template Reference

#include <EDProductfwd.h>

Public Types

typedef KEY key_type
 
typedef std::vector< KEY > keys_type
 
typedef keys_type::size_type size_type
 

Public Member Functions

void const * cachedMemberPointer (size_type idx) const
 
size_type capacity () const
 Capacity of vector. More...
 
void clear ()
 clear the vector More...
 
bool empty () const
 Is vector empty? More...
 
keys_type::iterator eraseAtIndex (size_type index)
 erase an element from the vector More...
 
keys_type const & keys () const
 Accessor for vector of keys and pointers. More...
 
RefVectorBaseoperator= (RefVectorBase &&rhs) noexcept
 
RefVectorBaseoperator= (RefVectorBase const &rhs)
 
void pushBack (RefCore const &product, KEY const &key)
 
RefCore const & refCore () const
 Accessor for product ID and product getter. More...
 
 RefVectorBase ()
 Default constructor needed for reading from persistent store. Not for direct use. More...
 
 RefVectorBase (ProductID const &productID, void const *prodPtr=nullptr, EDProductGetter const *prodGetter=nullptr)
 
 RefVectorBase (RefVectorBase &&rhs) noexcept
 
 RefVectorBase (RefVectorBase const &rhs)
 
void reserve (size_type n)
 Reserve space for vector. More...
 
size_type size () const
 Size of vector. More...
 
void swap (RefVectorBase< KEY > &other) noexcept
 swap two vectors More...
 
 ~RefVectorBase () noexcept
 Destructor. More...
 

Static Public Member Functions

static short Class_Version ()
 

Private Member Functions

std::vector< void const * > const & memberPointers () const
 

Private Attributes

keys_type keys_
 
RefVectorMemberPointersHolder memberPointersHolder_
 
RefCore product_
 

Detailed Description

template<typename KEY>
class edm::RefVectorBase< KEY >

Definition at line 31 of file EDProductfwd.h.

Member Typedef Documentation

◆ key_type

template<typename KEY>
typedef KEY edm::RefVectorBase< KEY >::key_type

Definition at line 34 of file RefVectorBase.h.

◆ keys_type

template<typename KEY>
typedef std::vector<KEY> edm::RefVectorBase< KEY >::keys_type

Definition at line 33 of file RefVectorBase.h.

◆ size_type

template<typename KEY>
typedef keys_type::size_type edm::RefVectorBase< KEY >::size_type

Definition at line 35 of file RefVectorBase.h.

Constructor & Destructor Documentation

◆ RefVectorBase() [1/4]

template<typename KEY>
edm::RefVectorBase< KEY >::RefVectorBase ( )
inline

Default constructor needed for reading from persistent store. Not for direct use.

Definition at line 37 of file RefVectorBase.h.

37 : product_(), keys_() {}

◆ RefVectorBase() [2/4]

template<typename KEY>
edm::RefVectorBase< KEY >::RefVectorBase ( RefVectorBase< KEY > const &  rhs)
inline

Definition at line 38 of file RefVectorBase.h.

39  : product_(rhs.product_), keys_(rhs.keys_), memberPointersHolder_(rhs.memberPointersHolder_) {}

◆ RefVectorBase() [3/4]

template<typename KEY>
edm::RefVectorBase< KEY >::RefVectorBase ( RefVectorBase< KEY > &&  rhs)
inlinenoexcept

Definition at line 40 of file RefVectorBase.h.

41  : product_(std::move(rhs.product_)),
42  keys_(std::move(rhs.keys_)),
43  memberPointersHolder_(std::move(rhs.memberPointersHolder_)) {}

◆ RefVectorBase() [4/4]

template<typename KEY>
edm::RefVectorBase< KEY >::RefVectorBase ( ProductID const &  productID,
void const *  prodPtr = nullptr,
EDProductGetter const *  prodGetter = nullptr 
)
inlineexplicit

Definition at line 57 of file RefVectorBase.h.

60  : product_(productID, prodPtr, prodGetter, false), keys_() {}

◆ ~RefVectorBase()

template<typename KEY>
edm::RefVectorBase< KEY >::~RefVectorBase ( )
inlinenoexcept

Destructor.

Definition at line 63 of file RefVectorBase.h.

63 {}

Member Function Documentation

◆ cachedMemberPointer()

template<typename KEY>
void const* edm::RefVectorBase< KEY >::cachedMemberPointer ( size_type  idx) const
inline

◆ capacity()

template<typename KEY>
size_type edm::RefVectorBase< KEY >::capacity ( ) const
inline

Capacity of vector.

Definition at line 99 of file RefVectorBase.h.

99 { return keys_.capacity(); }

Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::capacity().

◆ Class_Version()

template<typename KEY>
static short edm::RefVectorBase< KEY >::Class_Version ( )
inlinestatic

Definition at line 125 of file RefVectorBase.h.

127 :
128  std::vector<void const*> const& memberPointers() const { return memberPointersHolder_.memberPointers(); }

◆ clear()

template<typename KEY>
void edm::RefVectorBase< KEY >::clear ( void  )
inline

clear the vector

Definition at line 111 of file RefVectorBase.h.

111  {
112  keys_.clear();
114  product_ = RefCore();
115  }

Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::clear(), and BeautifulSoup.Tag::setString().

◆ empty()

template<typename KEY>
bool edm::RefVectorBase< KEY >::empty ( ) const
inline

Is vector empty?

Definition at line 76 of file RefVectorBase.h.

76 { return keys_.empty(); }

Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::empty(), and edm::RefVectorBase< key_type >::pushBack().

◆ eraseAtIndex()

template<typename KEY>
keys_type::iterator edm::RefVectorBase< KEY >::eraseAtIndex ( size_type  index)
inline

erase an element from the vector

Definition at line 105 of file RefVectorBase.h.

105  {
107  return keys_.erase(keys_.begin() + index);
108  }

Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::erase().

◆ keys()

template<typename KEY>
keys_type const& edm::RefVectorBase< KEY >::keys ( ) const
inline

◆ memberPointers()

template<typename KEY>
std::vector<void const*> const& edm::RefVectorBase< KEY >::memberPointers ( ) const
inlineprivate

◆ operator=() [1/2]

template<typename KEY>
RefVectorBase& edm::RefVectorBase< KEY >::operator= ( RefVectorBase< KEY > &&  rhs)
inlinenoexcept

Definition at line 50 of file RefVectorBase.h.

50  {
51  product_ = std::move(rhs.product_);
52  keys_ = std::move(rhs.keys_);
53  memberPointersHolder_ = std::move(rhs.memberPointersHolder_);
54  return *this;
55  }

◆ operator=() [2/2]

template<typename KEY>
RefVectorBase& edm::RefVectorBase< KEY >::operator= ( RefVectorBase< KEY > const &  rhs)
inline

Definition at line 45 of file RefVectorBase.h.

45  {
46  RefVectorBase temp(rhs);
47  this->swap(temp);
48  return *this;
49  }

◆ pushBack()

template<typename KEY>
void edm::RefVectorBase< KEY >::pushBack ( RefCore const &  product,
KEY const &  key 
)
inline

Definition at line 81 of file RefVectorBase.h.

81  {
82  product_.pushBackRefItem(product);
83  if (product.productPtr() != nullptr) {
84  if (memberPointers().empty()) {
85  memberPointersHolder_.memberPointers().resize(keys_.size(), nullptr);
86  }
87  memberPointersHolder_.memberPointers().push_back(product.productPtr());
88  keys_.push_back(key);
89  return;
90  } else {
91  if (!memberPointers().empty()) {
92  memberPointersHolder_.memberPointers().push_back(nullptr);
93  }
94  keys_.push_back(key);
95  }
96  }

Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::push_back().

◆ refCore()

template<typename KEY>
RefCore const& edm::RefVectorBase< KEY >::refCore ( ) const
inline

◆ reserve()

template<typename KEY>
void edm::RefVectorBase< KEY >::reserve ( size_type  n)
inline

Reserve space for vector.

Definition at line 102 of file RefVectorBase.h.

102 { keys_.reserve(n); }

Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::reserve().

◆ size()

template<typename KEY>
size_type edm::RefVectorBase< KEY >::size ( void  ) const
inline

◆ swap()

template<typename KEY>
void edm::RefVectorBase< KEY >::swap ( RefVectorBase< KEY > &  other)
inlinenoexcept

swap two vectors

Definition at line 118 of file RefVectorBase.h.

118  {
119  product_.swap(other.product_);
120  keys_.swap(other.keys_);
121  memberPointersHolder_.memberPointers().swap(other.memberPointersHolder_.memberPointers());
122  }

Referenced by edm::RefVectorBase< key_type >::operator=(), and edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::swap().

Member Data Documentation

◆ keys_

template<typename KEY>
keys_type edm::RefVectorBase< KEY >::keys_
private

◆ memberPointersHolder_

template<typename KEY>
RefVectorMemberPointersHolder edm::RefVectorBase< KEY >::memberPointersHolder_
private

◆ product_

template<typename KEY>
RefCore edm::RefVectorBase< KEY >::product_
private
edm::RefCore::swap
void swap(RefCore &) noexcept
Definition: RefCore.h:149
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::RefVectorBase::swap
void swap(RefVectorBase< KEY > &other) noexcept
swap two vectors
Definition: RefVectorBase.h:118
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
edm::RefVectorBase::empty
bool empty() const
Is vector empty?
Definition: RefVectorBase.h:76
trackingPlots.other
other
Definition: trackingPlots.py:1464
edm::RefVectorBase::RefVectorBase
RefVectorBase()
Default constructor needed for reading from persistent store. Not for direct use.
Definition: RefVectorBase.h:37
edm::RefVectorBase::product_
RefCore product_
Definition: RefVectorBase.h:130
edm::RefVectorBase::memberPointersHolder_
RefVectorMemberPointersHolder memberPointersHolder_
Definition: RefVectorBase.h:132
edm::RefCore::pushBackRefItem
void pushBackRefItem(RefCore const &productToBeInserted)
Definition: RefCore.cc:215
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::RefVectorMemberPointersHolder::memberPointers
std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:23
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
crabWrapper.key
key
Definition: crabWrapper.py:19
edm::RefVectorBase::keys_
keys_type keys_
Definition: RefVectorBase.h:131
edm::RefVectorBase::memberPointers
std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:128