Home ⌂Doc Index ◂Up ▴
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 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)
 

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 ) { }
Allocator< T > base_allocator_type

◆ 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 ) ) { }
Allocator< T > base_allocator_type

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  }
base_allocator_type::pointer pointer
base_allocator_type::value_type value_type

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

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.