CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
edmNew::DetSetVector< T >::FastFiller Class Reference

#include <DetSetVectorNew.h>

Public Types

typedef DetSetVector< T >::id_type id_type
 
typedef DetSetVector< T >::id_type key_type
 
typedef DetSetVector< T >::size_type size_type
 
typedef DetSetVector< T >::data_type value_type
 

Public Member Functions

void abort ()
 
data_typeback ()
 
DataIter begin ()
 
void checkCapacityExausted () const
 
void checkCapacityExausted (size_type s) const
 
bool empty () const
 
DataIter end ()
 
 FastFiller (DetSetVector< T > &iv, id_type id, bool isaveEmpty=false)
 
 FastFiller (DetSetVector< T > &iv, typename DetSetVector< T >::Item &it, bool isaveEmpty=false)
 
id_type id () const
 
data_typeoperator[] (size_type i)
 
void push_back (data_type const &d)
 
void push_back (data_type &&d)
 
void reserve (size_type s)
 
void resize (size_type s)
 
size_type size () const
 
 ~FastFiller ()
 

Static Public Member Functions

static DetSetVector< T >::Itemdummy ()
 

Private Attributes

DetSetVector< T >::Itemm_item
 
bool m_saveEmpty
 
DetSetVector< T > & m_v
 

Friends

class ::TestDetSet
 

Detailed Description

template<typename T>
class edmNew::DetSetVector< T >::FastFiller

Definition at line 225 of file DetSetVectorNew.h.

Member Typedef Documentation

template<typename T>
typedef DetSetVector<T>::id_type edmNew::DetSetVector< T >::FastFiller::id_type

Definition at line 229 of file DetSetVectorNew.h.

template<typename T>
typedef DetSetVector<T>::id_type edmNew::DetSetVector< T >::FastFiller::key_type

Definition at line 228 of file DetSetVectorNew.h.

Definition at line 230 of file DetSetVectorNew.h.

Definition at line 227 of file DetSetVectorNew.h.

Constructor & Destructor Documentation

template<typename T>
edmNew::DetSetVector< T >::FastFiller::FastFiller ( DetSetVector< T > &  iv,
id_type  id,
bool  isaveEmpty = false 
)
inline

Definition at line 237 of file DetSetVectorNew.h.

References edmNew::dstvdetails::notSafe().

237  :
238  m_v(iv), m_item(m_v.ready()? m_v.push_back(id): dummy()),m_saveEmpty(isaveEmpty) {
239  if (m_v.onDemand()) dstvdetails::notSafe();
240  }
static DetSetVector< T >::Item & dummy()
DetSetVector< T >::Item & m_item
template<typename T>
edmNew::DetSetVector< T >::FastFiller::FastFiller ( DetSetVector< T > &  iv,
typename DetSetVector< T >::Item it,
bool  isaveEmpty = false 
)
inline

Definition at line 242 of file DetSetVectorNew.h.

References edmNew::dstvdetails::notSafe().

242  :
243  m_v(iv), m_item(it), m_saveEmpty(isaveEmpty) {
244  if (m_v.onDemand()) dstvdetails::notSafe();
245  if(m_v.ready()) m_item.offset = int(m_v.m_data.size());
246 
247  }
DetSetVector< T >::Item & m_item
template<typename T>
edmNew::DetSetVector< T >::FastFiller::~FastFiller ( )
inline

Definition at line 248 of file DetSetVectorNew.h.

248  {
249  if (!m_saveEmpty && m_item.size==0) {
250  m_v.pop_back(m_item.id);
251  }
252  assert(m_v.m_filling==true);
253  m_v.m_filling=false;
254 
255  }
DetSetVector< T >::Item & m_item

Member Function Documentation

template<typename T>
void edmNew::DetSetVector< T >::FastFiller::abort ( )
inline

Definition at line 258 of file DetSetVectorNew.h.

Referenced by Phase2TrackerClusterizer::produce(), and SiStripRecHitConverterAlgorithm::run().

258  {
259  m_v.pop_back(m_item.id);
260  m_saveEmpty=true; // avoid mess in destructor
261  }
DetSetVector< T >::Item & m_item
template<typename T>
data_type& edmNew::DetSetVector< T >::FastFiller::back ( )
inline

Definition at line 309 of file DetSetVectorNew.h.

309 { return m_v.m_data.back();}
template<typename T>
DataIter edmNew::DetSetVector< T >::FastFiller::begin ( void  )
inline
template<typename T>
void edmNew::DetSetVector< T >::FastFiller::checkCapacityExausted ( ) const
inline

Definition at line 263 of file DetSetVectorNew.h.

References edmNew::dstvdetails::throwCapacityExausted().

263  {
264  if (m_v.onDemand() && m_v.m_data.size()==m_v.m_data.capacity()) dstvdetails::throwCapacityExausted();
265  }
template<typename T>
void edmNew::DetSetVector< T >::FastFiller::checkCapacityExausted ( size_type  s) const
inline

Definition at line 267 of file DetSetVectorNew.h.

References edmNew::dstvdetails::throwCapacityExausted().

267  {
268  if (m_v.onDemand() && m_v.m_data.size()+s>m_v.m_data.capacity()) dstvdetails::throwCapacityExausted();
269  }
template<typename T>
static DetSetVector<T>::Item& edmNew::DetSetVector< T >::FastFiller::dummy ( )
inlinestatic

Definition at line 233 of file DetSetVectorNew.h.

References edmIntegrityCheck::d.

233  {
234  assert(false);
235  static DetSetVector<T>::Item d; return d;
236  }
template<typename T>
bool edmNew::DetSetVector< T >::FastFiller::empty ( ) const
inline
template<typename T>
DataIter edmNew::DetSetVector< T >::FastFiller::end ( void  )
inline
template<typename T>
id_type edmNew::DetSetVector< T >::FastFiller::id ( ) const
inline

Definition at line 286 of file DetSetVectorNew.h.

template<typename T>
data_type& edmNew::DetSetVector< T >::FastFiller::operator[] ( size_type  i)
inline

Definition at line 290 of file DetSetVectorNew.h.

References mps_fire::i.

290  {
291  return m_v.m_data[m_item.offset+i];
292  }
DetSetVector< T >::Item & m_item
template<typename T>
void edmNew::DetSetVector< T >::FastFiller::push_back ( data_type const &  d)
inline
template<typename T>
void edmNew::DetSetVector< T >::FastFiller::push_back ( data_type &&  d)
inline

Definition at line 302 of file DetSetVectorNew.h.

References edmIntegrityCheck::d, and eostools::move().

302  {
304  m_v.m_data.push_back(std::move(d));
305  ++m_v.m_dataSize;
306  m_item.size++;
307  }
DetSetVector< T >::Item & m_item
def move(src, dest)
Definition: eostools.py:511
template<typename T>
void edmNew::DetSetVector< T >::FastFiller::reserve ( size_type  s)
inline

Definition at line 272 of file DetSetVectorNew.h.

References edmNew::dstvdetails::throwCapacityExausted().

272  {
273  if (m_item.offset+s <= m_v.m_data.capacity()) return;
274  if (m_v.onDemand()) dstvdetails::throwCapacityExausted();
275  m_v.m_data.reserve(m_item.offset+s);
276  }
DetSetVector< T >::Item & m_item
template<typename T>
void edmNew::DetSetVector< T >::FastFiller::resize ( size_type  s)
inline
template<typename T>
size_type edmNew::DetSetVector< T >::FastFiller::size ( void  ) const
inline

Friends And Related Function Documentation

template<typename T>
friend class ::TestDetSet
friend

Definition at line 313 of file DetSetVectorNew.h.

Member Data Documentation

template<typename T>
DetSetVector<T>::Item& edmNew::DetSetVector< T >::FastFiller::m_item
private

Definition at line 316 of file DetSetVectorNew.h.

template<typename T>
bool edmNew::DetSetVector< T >::FastFiller::m_saveEmpty
private

Definition at line 317 of file DetSetVectorNew.h.

template<typename T>
DetSetVector<T>& edmNew::DetSetVector< T >::FastFiller::m_v
private

Definition at line 315 of file DetSetVectorNew.h.