CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::RefVectorBase< T > 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 const &rhs)
 
RefVectorBaseoperator= (RefVectorBase &&rhs) noexcept
 
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 (RefVectorBase const &rhs)
 
 RefVectorBase (RefVectorBase &&rhs) noexcept
 
 RefVectorBase (ProductID const &productID, void const *prodPtr=nullptr, EDProductGetter const *prodGetter=nullptr)
 
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 T>
class edm::RefVectorBase< T >

Definition at line 31 of file EDProductfwd.h.

Member Typedef Documentation

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

Definition at line 34 of file RefVectorBase.h.

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

Definition at line 33 of file RefVectorBase.h.

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

Definition at line 35 of file RefVectorBase.h.

Constructor & Destructor Documentation

template<typename T>
edm::RefVectorBase< T >::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_() {}
template<typename T>
edm::RefVectorBase< T >::RefVectorBase ( RefVectorBase< T > const &  rhs)
inline

Definition at line 38 of file RefVectorBase.h.

39  : product_(rhs.product_), keys_(rhs.keys_), memberPointersHolder_(rhs.memberPointersHolder_) {}
RefVectorMemberPointersHolder memberPointersHolder_
template<typename T>
edm::RefVectorBase< T >::RefVectorBase ( RefVectorBase< T > &&  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_)) {}
RefVectorMemberPointersHolder memberPointersHolder_
def move
Definition: eostools.py:511
template<typename T>
edm::RefVectorBase< T >::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_() {}
template<typename T>
edm::RefVectorBase< T >::~RefVectorBase ( )
inlinenoexcept

Destructor.

Definition at line 63 of file RefVectorBase.h.

63 {}

Member Function Documentation

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

Definition at line 68 of file RefVectorBase.h.

Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::at(), and edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::operator[]().

68  {
69  return memberPointers().empty() ? nullptr : memberPointers()[idx];
70  }
std::vector< void const * > const & memberPointers() const
template<typename T>
size_type edm::RefVectorBase< T >::capacity ( ) const
inline

Capacity of vector.

Definition at line 99 of file RefVectorBase.h.

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

99 { return keys_.capacity(); }
template<typename T>
static short edm::RefVectorBase< T >::Class_Version ( )
inlinestatic

Definition at line 125 of file RefVectorBase.h.

127 :
128  std::vector<void const*> const& memberPointers() const { return memberPointersHolder_.memberPointers(); }
std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:23
RefVectorMemberPointersHolder memberPointersHolder_
std::vector< void const * > const & memberPointers() const
template<typename T>
void edm::RefVectorBase< T >::clear ( void  )
inline

clear the vector

Definition at line 111 of file RefVectorBase.h.

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

111  {
112  keys_.clear();
114  product_ = RefCore();
115  }
std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:23
RefVectorMemberPointersHolder memberPointersHolder_
template<typename T>
bool edm::RefVectorBase< T >::empty ( ) const
inline

Is vector empty?

Definition at line 76 of file RefVectorBase.h.

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

76 { return keys_.empty(); }
template<typename T>
keys_type::iterator edm::RefVectorBase< T >::eraseAtIndex ( size_type  index)
inline

erase an element from the vector

Definition at line 105 of file RefVectorBase.h.

Referenced by edm::RefVector< C, T, F >::erase().

105  {
107  return keys_.erase(keys_.begin() + index);
108  }
std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:23
RefVectorMemberPointersHolder memberPointersHolder_
template<typename T>
keys_type const& edm::RefVectorBase< T >::keys ( ) const
inline
template<typename T>
std::vector<void const*> const& edm::RefVectorBase< T >::memberPointers ( ) const
inlineprivate

Definition at line 128 of file RefVectorBase.h.

Referenced by edm::RefVectorBase< key_type >::cachedMemberPointer(), and edm::RefVectorBase< key_type >::pushBack().

std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:23
RefVectorMemberPointersHolder memberPointersHolder_
template<typename T>
RefVectorBase& edm::RefVectorBase< T >::operator= ( RefVectorBase< T > const &  rhs)
inline

Definition at line 45 of file RefVectorBase.h.

45  {
46  RefVectorBase temp(rhs);
47  this->swap(temp);
48  return *this;
49  }
RefVectorBase()
Default constructor needed for reading from persistent store. Not for direct use. ...
Definition: RefVectorBase.h:37
void swap(RefVectorBase< KEY > &other) noexcept
swap two vectors
template<typename T>
RefVectorBase& edm::RefVectorBase< T >::operator= ( RefVectorBase< T > &&  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  }
RefVectorMemberPointersHolder memberPointersHolder_
def move
Definition: eostools.py:511
template<typename T>
void edm::RefVectorBase< T >::pushBack ( RefCore const &  product,
KEY const &  key 
)
inline

Definition at line 81 of file RefVectorBase.h.

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

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  }
bool empty() const
Is vector empty?
Definition: RefVectorBase.h:76
std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:23
RefVectorMemberPointersHolder memberPointersHolder_
std::vector< void const * > const & memberPointers() const
tuple key
prepare the HTCondor submission files and eventually submit them
void pushBackRefItem(RefCore const &productToBeInserted)
Definition: RefCore.cc:215
template<typename T>
RefCore const& edm::RefVectorBase< T >::refCore ( ) const
inline
template<typename T>
void edm::RefVectorBase< T >::reserve ( size_type  n)
inline

Reserve space for vector.

Definition at line 102 of file RefVectorBase.h.

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

102 { keys_.reserve(n); }
template<typename T>
size_type edm::RefVectorBase< T >::size ( void  ) const
inline
template<typename T>
void edm::RefVectorBase< T >::swap ( RefVectorBase< KEY > &  other)
inlinenoexcept

swap two vectors

Definition at line 118 of file RefVectorBase.h.

Referenced by edm::RefVectorBase< key_type >::operator=(), edm::RefVector< C, T, F >::swap(), and edm::swap().

118  {
119  product_.swap(other.product_);
120  keys_.swap(other.keys_);
121  memberPointersHolder_.memberPointers().swap(other.memberPointersHolder_.memberPointers());
122  }
void swap(RefCore &) noexcept
Definition: RefCore.h:149
std::vector< void const * > const & memberPointers() const
Definition: RefVectorBase.h:23
RefVectorMemberPointersHolder memberPointersHolder_

Member Data Documentation

template<typename T>
keys_type edm::RefVectorBase< T >::keys_
private
template<typename T>
RefVectorMemberPointersHolder edm::RefVectorBase< T >::memberPointersHolder_
private
template<typename T>
RefCore edm::RefVectorBase< T >::product_
private