CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
CLHEP::HepGenMatrix::Alloc< T, size > Class Template Reference

#include <GenMatrix.h>

Classes

struct  rebind
 

Public Types

typedef T value_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T & reference
 
typedef const T & const_reference
 

Public Member Functions

pointer address (reference r) const
 
const_pointer address (const_reference r) const
 
 Alloc () throw ()
 
 Alloc (const Alloc< T, size > &) throw ()
 
 ~Alloc () throw ()
 
pointer allocate (size_type n, const void *hint=0)
 
void deallocate (pointer p, size_type n)
 
void construct (pointer p, const T &val)
 
void destroy (pointer p)
 
size_type max_size () const throw ()
 

Detailed Description

template<class T, size_t size>
class CLHEP::HepGenMatrix::Alloc< T, size >

Definition at line 40 of file GenMatrix.h.

Member Typedef Documentation

◆ const_pointer

template<class T , size_t size>
typedef const T* CLHEP::HepGenMatrix::Alloc< T, size >::const_pointer

Definition at line 48 of file GenMatrix.h.

◆ const_reference

template<class T , size_t size>
typedef const T& CLHEP::HepGenMatrix::Alloc< T, size >::const_reference

Definition at line 50 of file GenMatrix.h.

◆ difference_type

template<class T , size_t size>
typedef ptrdiff_t CLHEP::HepGenMatrix::Alloc< T, size >::difference_type

Definition at line 46 of file GenMatrix.h.

◆ pointer

template<class T , size_t size>
typedef T* CLHEP::HepGenMatrix::Alloc< T, size >::pointer

Definition at line 47 of file GenMatrix.h.

◆ reference

template<class T , size_t size>
typedef T& CLHEP::HepGenMatrix::Alloc< T, size >::reference

Definition at line 49 of file GenMatrix.h.

◆ size_type

template<class T , size_t size>
typedef size_t CLHEP::HepGenMatrix::Alloc< T, size >::size_type

Definition at line 45 of file GenMatrix.h.

◆ value_type

template<class T , size_t size>
typedef T CLHEP::HepGenMatrix::Alloc< T, size >::value_type

Definition at line 44 of file GenMatrix.h.

Constructor & Destructor Documentation

◆ Alloc() [1/2]

template<class T , size_t size>
CLHEP::HepGenMatrix::Alloc< T, size >::Alloc ( )
throw (
)
inline

Definition at line 54 of file GenMatrix.h.

54{}

◆ Alloc() [2/2]

template<class T , size_t size>
CLHEP::HepGenMatrix::Alloc< T, size >::Alloc ( const Alloc< T, size > &  )
throw (
)
inline

Definition at line 55 of file GenMatrix.h.

55{}

◆ ~Alloc()

template<class T , size_t size>
CLHEP::HepGenMatrix::Alloc< T, size >::~Alloc ( )
throw (
)
inline

Definition at line 56 of file GenMatrix.h.

56{}

Member Function Documentation

◆ address() [1/2]

template<class T , size_t size>
const_pointer CLHEP::HepGenMatrix::Alloc< T, size >::address ( const_reference  r) const
inline

Definition at line 53 of file GenMatrix.h.

53{ return &r; }

◆ address() [2/2]

template<class T , size_t size>
pointer CLHEP::HepGenMatrix::Alloc< T, size >::address ( reference  r) const
inline

Definition at line 52 of file GenMatrix.h.

52{ return &r; }

◆ allocate()

template<class T , size_t size>
pointer CLHEP::HepGenMatrix::Alloc< T, size >::allocate ( size_type  n,
const void *  hint = 0 
)
inline

Definition at line 57 of file GenMatrix.h.

57{ if( n <= size ) return pool; else return new T[n]; }

◆ construct()

template<class T , size_t size>
void CLHEP::HepGenMatrix::Alloc< T, size >::construct ( pointer  p,
const T &  val 
)
inline

Definition at line 59 of file GenMatrix.h.

59{ new(p) T(val); }

◆ deallocate()

template<class T , size_t size>
void CLHEP::HepGenMatrix::Alloc< T, size >::deallocate ( pointer  p,
size_type  n 
)
inline

Definition at line 58 of file GenMatrix.h.

58{ if (p == pool ) return; delete [] p; }

◆ destroy()

template<class T , size_t size>
void CLHEP::HepGenMatrix::Alloc< T, size >::destroy ( pointer  p)
inline

Definition at line 60 of file GenMatrix.h.

60{ p->~T(); }

◆ max_size()

template<class T , size_t size>
size_type CLHEP::HepGenMatrix::Alloc< T, size >::max_size ( ) const
throw (
)
inline

Definition at line 61 of file GenMatrix.h.

61{ size_type c = (size_type)(-1) /sizeof(T); return (0 < c ? c : 1); }

The documentation for this class was generated from the following file: