Crypto++  5.6.3
Free C++ class library of cryptographic schemes
Public Types | Public Member Functions | List of all members
NullAllocator< T > Class Template Reference

NULL allocator. More...

+ Inheritance diagram for NullAllocator< T >:

Public Types

typedef AllocatorBase< T >::value_type value_type
 
typedef AllocatorBase< T >::size_type size_type
 
typedef AllocatorBase< T >::difference_type difference_type
 
typedef AllocatorBase< T >::pointer pointer
 
typedef AllocatorBase< T >::const_pointer const_pointer
 
typedef AllocatorBase< T >::reference reference
 
typedef AllocatorBase< T >::const_reference const_reference
 

Public Member Functions

pointer allocate (size_type n, const void *unused=NULL)
 
void deallocate (void *p, size_type n)
 
size_type max_size () const
 
pointer address (reference r) const
 
const_pointer address (const_reference r) const
 
void construct (pointer p, const T &val)
 
template<typename U , typename... Args>
void construct (U *ptr, Args &&...args)
 Constructs a new U using variadic arguments. More...
 
void destroy (pointer p)
 
template<typename U >
void destroy (U *ptr)
 Destroys an U constructed with variadic arguments. More...
 

Detailed Description

template<class T>
class NullAllocator< T >

NULL allocator.

Template Parameters
Tclass or type

A NullAllocator is useful for fixed-size, stack based allocations (i.e., static arrays used by FixedSizeAllocatorWithCleanup).

A NullAllocator always returns 0 for max_size(), and always returns NULL for allocation requests. Though the allocator does not allocate at runtime, it does perform a secure wipe or zeroization during cleanup.

Definition at line 250 of file secblock.h.

Member Function Documentation

template<class T>
template<typename U , typename... Args>
void AllocatorBase< T >::construct ( U *  ptr,
Args &&...  args 
)
inlineinherited

Constructs a new U using variadic arguments.

Template Parameters
Uthe type to be forwarded
Argsthe arguments to be forwarded
Parameters
ptrpointer to type U
argsvariadic arguments

This is a C++11 feature. It is available when CRYPTOPP_CXX11_VARIADIC_TEMPLATES is defined. The define is controlled by compiler versions detected in config.h.

Definition at line 64 of file secblock.h.

template<class T>
template<typename U >
void AllocatorBase< T >::destroy ( U *  ptr)
inlineinherited

Destroys an U constructed with variadic arguments.

Template Parameters
Uthe type to be forwarded

This is a C++11 feature. It is available when CRYPTOPP_CXX11_VARIADIC_TEMPLATES is defined. The define is controlled by compiler versions detected in config.h.

Definition at line 71 of file secblock.h.


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