CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
edmNew::DetSetVector< T >::TSFastFiller 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 ()
 
bool empty () const
 
DataIter end ()
 
bool full () const
 
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
 
 TSFastFiller (DetSetVector< T > &iv, id_type id)
 
 TSFastFiller (DetSetVector< T > const &iv, typename DetSetVector< T >::Item const &it)
 
 ~TSFastFiller ()
 

Static Public Member Functions

static DetSetVector< T >::Item const & dummy ()
 

Private Attributes

DetSetVector< T >::Item const & m_item
 
std::vector< Tm_lv
 
DetSetVector< T > const & m_v
 

Friends

class ::TestDetSet
 

Detailed Description

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

Definition at line 322 of file DetSetVectorNew.h.

Member Typedef Documentation

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

Definition at line 326 of file DetSetVectorNew.h.

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

Definition at line 325 of file DetSetVectorNew.h.

Definition at line 327 of file DetSetVectorNew.h.

Definition at line 324 of file DetSetVectorNew.h.

Constructor & Destructor Documentation

template<typename T>
edmNew::DetSetVector< T >::TSFastFiller::TSFastFiller ( DetSetVector< T > &  iv,
id_type  id 
)
inline

Definition at line 336 of file DetSetVectorNew.h.

336  :
337  m_v(iv), m_item(m_v.ready()? iv.push_back(id): dummy()) { assert(m_v.m_filling==true); m_v.m_filling = false;}
DetSetVector< T > const & m_v
static DetSetVector< T >::Item const & dummy()
DetSetVector< T >::Item const & m_item
template<typename T>
edmNew::DetSetVector< T >::TSFastFiller::TSFastFiller ( DetSetVector< T > const &  iv,
typename DetSetVector< T >::Item const &  it 
)
inline

Definition at line 339 of file DetSetVectorNew.h.

339  :
340  m_v(iv), m_item(it) {
341 
342  }
DetSetVector< T > const & m_v
DetSetVector< T >::Item const & m_item
template<typename T>
edmNew::DetSetVector< T >::TSFastFiller::~TSFastFiller ( )
inline

Definition at line 343 of file DetSetVectorNew.h.

References full, eostools::move(), PFRecoTauDiscriminationByIsolation_cfi::offset, and edmNew::dstvdetails::throwCapacityExausted().

343  {
344  bool expected=false;
345  while (!m_v.m_filling.compare_exchange_weak(expected,true)) { expected=false; nanosleep(nullptr,nullptr);}
346  int offset = m_v.m_data.size();
347  if (m_v.onDemand() && full()) {
348  m_v.m_filling = false;
350  }
351  std::move(m_lv.begin(), m_lv.end(), std::back_inserter(m_v.m_data));
352  m_item.size=m_lv.size();
353  m_item.offset = offset;
354 
355  m_v.m_dataSize = m_v.m_data.size();
356  assert(m_v.m_filling==true);
357  m_v.m_filling = false;
358  }
DetSetVector< T > const & m_v
DetSetVector< T >::Item const & m_item
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

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

Definition at line 367 of file DetSetVectorNew.h.

Referenced by SiStripClusterizerFromRaw::run().

367  {
368  m_lv.clear();
369  }
template<typename T>
data_type& edmNew::DetSetVector< T >::TSFastFiller::back ( )
inline

Definition at line 396 of file DetSetVectorNew.h.

396 { return m_lv.back();}
template<typename T>
DataIter edmNew::DetSetVector< T >::TSFastFiller::begin ( void  )
inline

Definition at line 386 of file DetSetVectorNew.h.

386 { return m_lv.begin();}
template<typename T>
static DetSetVector<T>::Item const& edmNew::DetSetVector< T >::TSFastFiller::dummy ( )
inlinestatic

Definition at line 331 of file DetSetVectorNew.h.

References edmIntegrityCheck::d.

331  {
332  assert(false);
333  static DetSetVector<T>::Item const d; return d;
334  }
template<typename T>
bool edmNew::DetSetVector< T >::TSFastFiller::empty ( ) const
inline
template<typename T>
DataIter edmNew::DetSetVector< T >::TSFastFiller::end ( void  )
inline

Definition at line 387 of file DetSetVectorNew.h.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

387 { return m_lv.end();}
template<typename T>
bool edmNew::DetSetVector< T >::TSFastFiller::full ( ) const
inline

Definition at line 362 of file DetSetVectorNew.h.

References PFRecoTauDiscriminationByIsolation_cfi::offset.

Referenced by SiStripClusterizerFromRaw::run().

362  {
363  int offset = m_v.m_dataSize;
364  return m_v.m_data.capacity()<offset+m_lv.size();
365  }
DetSetVector< T > const & m_v
template<typename T>
id_type edmNew::DetSetVector< T >::TSFastFiller::id ( ) const
inline

Definition at line 379 of file DetSetVectorNew.h.

Referenced by SiStripClusterizerFromRaw::run().

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

Definition at line 383 of file DetSetVectorNew.h.

References mps_fire::i.

383  {
384  return m_lv[i];
385  }
template<typename T>
void edmNew::DetSetVector< T >::TSFastFiller::push_back ( data_type const &  d)
inline

Definition at line 389 of file DetSetVectorNew.h.

389  {
390  m_lv.push_back(d);
391  }
template<typename T>
void edmNew::DetSetVector< T >::TSFastFiller::push_back ( data_type &&  d)
inline

Definition at line 392 of file DetSetVectorNew.h.

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

392  {
393  m_lv.push_back(std::move(d));
394  }
def move(src, dest)
Definition: eostools.py:511
template<typename T>
void edmNew::DetSetVector< T >::TSFastFiller::reserve ( size_type  s)
inline

Definition at line 371 of file DetSetVectorNew.h.

371  {
372  m_lv.reserve(s);
373  }
template<typename T>
void edmNew::DetSetVector< T >::TSFastFiller::resize ( size_type  s)
inline
template<typename T>
size_type edmNew::DetSetVector< T >::TSFastFiller::size ( void  ) const
inline

Friends And Related Function Documentation

template<typename T>
friend class ::TestDetSet
friend

Definition at line 400 of file DetSetVectorNew.h.

Member Data Documentation

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

Definition at line 404 of file DetSetVectorNew.h.

template<typename T>
std::vector<T> edmNew::DetSetVector< T >::TSFastFiller::m_lv
private

Definition at line 402 of file DetSetVectorNew.h.

template<typename T>
DetSetVector<T> const& edmNew::DetSetVector< T >::TSFastFiller::m_v
private

Definition at line 403 of file DetSetVectorNew.h.