pmem::obj::object_traits< T > Class Template Reference

Encapsulates object specific allocator functionality. More...

`#include <libpmemobj++/allocator.hpp>`

## Classes

struct | rebind
| Rebind to a different type. More...

## Public Member Functions

| object_traits ()=default
| Defaulted constructor.
| ~object_traits ()=default
| Defaulted destructor.
template<typename U , typename = typename std::enable_if< std::is_convertible<U *, T *>::value>::type>
| object_traits (object_traits< U > const &)
| Type converting constructor.
void | construct (pointer p, const_reference t)
| Create an object at a specific address. More...
template<typename... Args>
void | construct (pointer p, Args &&... args)
| Create an object at a specific address. More...
void | destroy (pointer p)
| Destroy an object based on a pointer. More...

## Detailed Description

### template<typename T>
class pmem::obj::object_traits< T >

Encapsulates object specific allocator functionality.

Designed to be used with C++ allocators. Can be specialized if necessary.

## Member Function Documentation

## construct() [1/2]

template<typename T >

void pmem::obj::object_traits< T >::construct | ( | pointer | p,
|  | const_reference | t
| ) |  |

inline

Create an object at a specific address.

This should be called only within a transaction.

Parameters

  [in] | p | the pointer to where the object will be constructed.
  [in] | t | the object reference for copy construction.

## construct() [2/2]

template<typename T >
template<typename... Args>

void pmem::obj::object_traits< T >::construct | ( | pointer | p,
|  | Args &&... | args
| ) |  |

inline

Create an object at a specific address.

This should be called only within a transaction.

Parameters

  [in] | p | the pointer to where the object will be constructed.
  [in] | args | parameters passed to the object's constructor.

## destroy()

template<typename T >

void pmem::obj::object_traits< T >::destroy | ( | pointer | p | ) |

inline

Destroy an object based on a pointer.

This should be called only within a transaction.

Parameters

  [in] | p | the pointer to the object to be destroyed.

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

- pmdk-1.4.1/src/include/libpmemobj++/allocator.hpp