Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::zero_allocator< T, Allocator > Class Template Reference

Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5. More...

#include <tbb_allocator.h>

Inheritance diagram for tbb::zero_allocator< T, Allocator >:
Collaboration diagram for tbb::zero_allocator< T, Allocator >:

Classes

struct  rebind
 

Public Types

typedef Allocator< T > base_allocator_type
 
typedef base_allocator_type::value_type value_type
 
typedef base_allocator_type::pointer pointer
 
typedef base_allocator_type::const_pointer const_pointer
 
typedef base_allocator_type::reference reference
 
typedef base_allocator_type::const_reference const_reference
 
typedef base_allocator_type::size_type size_type
 
typedef base_allocator_type::difference_type difference_type
 
- Public Types inherited from tbb::tbb_allocator< T >
enum  malloc_type { scalable, standard }
 Specifies current allocator. More...
 
typedef internal::allocator_type< T >::value_type value_type
 
typedef value_typepointer
 
typedef value_typereference
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 

Public Member Functions

 zero_allocator () throw ()
 
 zero_allocator (const zero_allocator &a) throw ()
 
template<typename U >
 zero_allocator (const zero_allocator< U > &a) throw ()
 
pointer allocate (const size_type n, const void *hint=0)
 
- Public Member Functions inherited from tbb::tbb_allocator< T >
 tbb_allocator () throw ()
 
 tbb_allocator (const tbb_allocator &) throw ()
 
template<typename U >
 tbb_allocator (const tbb_allocator< U > &) throw ()
 
pointer address (reference x) const
 
const_pointer address (const_reference x) const
 
pointer allocate (size_type n, const void *=0)
 Allocate space for n objects. More...
 
void deallocate (pointer p, size_type)
 Free previously allocated block of memory. More...
 
size_type max_size () const throw ()
 Largest value for which method allocate might succeed. More...
 
void construct (pointer p, value_type &&value)
 Copy-construct value at location pointed to by p. More...
 
void construct (pointer p, const value_type &value)
 
void destroy (pointer p)
 Destroy value at location pointed to by p. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tbb::tbb_allocator< T >
static malloc_type allocator_type ()
 Returns current allocator. More...
 
- Public Attributes inherited from tbb::tbb_allocator< T >
const typedef value_typeconst_pointer
 
const typedef value_typeconst_reference
 

Detailed Description

template<typename T, template< typename X > class Allocator = tbb_allocator>
class tbb::zero_allocator< T, Allocator >

Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.

The class is an adapter over an actual allocator that fills the allocation using memset function with template argument C as the value. The members are ordered the same way they are in section 20.4.1 of the ISO C++ standard.

Definition at line 151 of file tbb_allocator.h.

Member Typedef Documentation

◆ base_allocator_type

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef Allocator<T> tbb::zero_allocator< T, Allocator >::base_allocator_type

Definition at line 154 of file tbb_allocator.h.

◆ const_pointer

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef base_allocator_type::const_pointer tbb::zero_allocator< T, Allocator >::const_pointer

Definition at line 157 of file tbb_allocator.h.

◆ const_reference

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef base_allocator_type::const_reference tbb::zero_allocator< T, Allocator >::const_reference

Definition at line 159 of file tbb_allocator.h.

◆ difference_type

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef base_allocator_type::difference_type tbb::zero_allocator< T, Allocator >::difference_type

Definition at line 161 of file tbb_allocator.h.

◆ pointer

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef base_allocator_type::pointer tbb::zero_allocator< T, Allocator >::pointer

Definition at line 156 of file tbb_allocator.h.

◆ reference

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef base_allocator_type::reference tbb::zero_allocator< T, Allocator >::reference

Definition at line 158 of file tbb_allocator.h.

◆ size_type

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef base_allocator_type::size_type tbb::zero_allocator< T, Allocator >::size_type

Definition at line 160 of file tbb_allocator.h.

◆ value_type

template<typename T , template< typename X > class Allocator = tbb_allocator>
typedef base_allocator_type::value_type tbb::zero_allocator< T, Allocator >::value_type

Definition at line 155 of file tbb_allocator.h.

Constructor & Destructor Documentation

◆ zero_allocator() [1/3]

template<typename T , template< typename X > class Allocator = tbb_allocator>
tbb::zero_allocator< T, Allocator >::zero_allocator ( )
throw (
)
inline

Definition at line 166 of file tbb_allocator.h.

166 { }

◆ zero_allocator() [2/3]

template<typename T , template< typename X > class Allocator = tbb_allocator>
tbb::zero_allocator< T, Allocator >::zero_allocator ( const zero_allocator< T, Allocator > &  a)
throw (
)
inline

Definition at line 167 of file tbb_allocator.h.

167 : base_allocator_type( a ) { }

◆ zero_allocator() [3/3]

template<typename T , template< typename X > class Allocator = tbb_allocator>
template<typename U >
tbb::zero_allocator< T, Allocator >::zero_allocator ( const zero_allocator< U > &  a)
throw (
)
inline

Definition at line 169 of file tbb_allocator.h.

169 : base_allocator_type( Allocator<U>( a ) ) { }

Member Function Documentation

◆ allocate()

template<typename T , template< typename X > class Allocator = tbb_allocator>
pointer tbb::zero_allocator< T, Allocator >::allocate ( const size_type  n,
const void hint = 0 
)
inline

Definition at line 171 of file tbb_allocator.h.

171  {
172  pointer ptr = base_allocator_type::allocate( n, hint );
173  std::memset( static_cast<void*>(ptr), 0, n * sizeof(value_type) );
174  return ptr;
175  }

The documentation for this class was generated from the following file:
tbb::zero_allocator::pointer
base_allocator_type::pointer pointer
Definition: tbb_allocator.h:156
tbb::zero_allocator::base_allocator_type
Allocator< T > base_allocator_type
Definition: tbb_allocator.h:154
tbb::zero_allocator::value_type
base_allocator_type::value_type value_type
Definition: tbb_allocator.h:155

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.