CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
mkfit::CcPool< T > Class Template Reference

#include <HitStructures.h>

Public Member Functions

Tallocate (std::size_t n)
 
 CcPool (std::size_t size=0)
 
void deallocate (T *p, std::size_t n) noexcept
 
void release ()
 
void reset (std::size_t size)
 

Private Attributes

std::vector< Tm_mem
 
std::size_t m_pos = 0
 
std::size_t m_size = 0
 

Detailed Description

template<class T>
class mkfit::CcPool< T >

Definition at line 325 of file HitStructures.h.

Constructor & Destructor Documentation

template<class T>
mkfit::CcPool< T >::CcPool ( std::size_t  size = 0)
inline

Definition at line 341 of file HitStructures.h.

341  {
342  if (size)
343  reset(size);
344  }
void reset(std::size_t size)
tuple size
Write out results.

Member Function Documentation

template<class T>
T* mkfit::CcPool< T >::allocate ( std::size_t  n)
inline

Definition at line 346 of file HitStructures.h.

346  {
347  if (m_pos + n > m_size)
348  throw std::bad_alloc();
349  T* ret = &m_mem[m_pos];
350  m_pos += n;
351  return ret;
352  }
tuple ret
prodAgent to be discontinued
std::size_t m_pos
std::vector< T > m_mem
long double T
std::size_t m_size
template<class T>
void mkfit::CcPool< T >::deallocate ( T p,
std::size_t  n 
)
inlinenoexcept

Definition at line 354 of file HitStructures.h.

354  {
355  // we do not care, implied deallocation of the whole pool on reset().
356  }
template<class T>
void mkfit::CcPool< T >::release ( )
inline

Definition at line 334 of file HitStructures.h.

334  {
335  std::vector<T> tmp;
336  m_mem.swap(tmp);
337  m_pos = 0;
338  m_size = 0;
339  }
std::size_t m_pos
std::vector< T > m_mem
tmp
align.sh
Definition: createJobs.py:716
std::size_t m_size
template<class T>
void mkfit::CcPool< T >::reset ( std::size_t  size)
inline

Definition at line 327 of file HitStructures.h.

Referenced by mkfit::CcPool< mkfit::TrackCand >::CcPool().

327  {
328  if (size > m_mem.size())
329  m_mem.resize(size);
330  m_pos = 0;
331  m_size = size;
332  }
std::size_t m_pos
std::vector< T > m_mem
tuple size
Write out results.
std::size_t m_size

Member Data Documentation

template<class T>
std::vector<T> mkfit::CcPool< T >::m_mem
private
template<class T>
std::size_t mkfit::CcPool< T >::m_pos = 0
private
template<class T>
std::size_t mkfit::CcPool< T >::m_size = 0
private