Botan  2.7.0
Crypto and TLS for C++11
Public Types | Public Member Functions | List of all members
Botan::secure_allocator< T > Class Template Reference

#include <secmem.h>

Public Types

typedef std::size_t size_type
 
typedef T value_type
 

Public Member Functions

Tallocate (std::size_t n)
 
void deallocate (T *p, std::size_t n)
 
secure_allocatoroperator= (const secure_allocator &) BOTAN_NOEXCEPT=default
 
 secure_allocator () BOTAN_NOEXCEPT=default
 
 secure_allocator (const secure_allocator &) BOTAN_NOEXCEPT=default
 
template<typename U >
 secure_allocator (const secure_allocator< U > &) BOTAN_NOEXCEPT
 
 ~secure_allocator () BOTAN_NOEXCEPT=default
 

Detailed Description

template<typename T>
class Botan::secure_allocator< T >

Definition at line 21 of file secmem.h.

Member Typedef Documentation

◆ size_type

template<typename T >
typedef std::size_t Botan::secure_allocator< T >::size_type

Definition at line 36 of file secmem.h.

◆ value_type

template<typename T >
typedef T Botan::secure_allocator< T >::value_type

Definition at line 32 of file secmem.h.

Constructor & Destructor Documentation

◆ secure_allocator() [1/3]

template<typename T >
Botan::secure_allocator< T >::secure_allocator ( )
default

◆ secure_allocator() [2/3]

template<typename T >
Botan::secure_allocator< T >::secure_allocator ( const secure_allocator< T > &  )
default

◆ ~secure_allocator()

template<typename T >
Botan::secure_allocator< T >::~secure_allocator ( )
default

◆ secure_allocator() [3/3]

template<typename T >
template<typename U >
Botan::secure_allocator< T >::secure_allocator ( const secure_allocator< U > &  )
inline

Definition at line 67 of file secmem.h.

67 {}

Member Function Documentation

◆ allocate()

template<typename T >
T* Botan::secure_allocator< T >::allocate ( std::size_t  n)
inline

Definition at line 69 of file secmem.h.

References Botan::allocate_memory(), and T.

70  {
71  return static_cast<T*>(allocate_memory(n, sizeof(T)));
72  }
BOTAN_MALLOC_FN void * allocate_memory(size_t elems, size_t elem_size)
Definition: mem_ops.cpp:16
fe T
Definition: ge.cpp:37

◆ deallocate()

template<typename T >
void Botan::secure_allocator< T >::deallocate ( T p,
std::size_t  n 
)
inline

Definition at line 74 of file secmem.h.

References Botan::deallocate_memory(), and T.

75  {
76  deallocate_memory(p, n, sizeof(T));
77  }
void deallocate_memory(void *p, size_t elems, size_t elem_size)
Definition: mem_ops.cpp:29
fe T
Definition: ge.cpp:37

◆ operator=()

template<typename T >
secure_allocator& Botan::secure_allocator< T >::operator= ( const secure_allocator< T > &  )
default

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