ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Functions
base::core Namespace Reference

Classes

class  Allocator
 An abstract base class for memory allocators. More...
 
class  BFCAllocator
 An allocator that allocates memory on a GPU device. More...
 
class  counted_base
 The base class for reference-counted objects. More...
 
class  CPUAllocator
 An Allocator subclass for CPU memory. More...
 
class  GPUAllocator
 An allocator that allocates memory on a GPU device. More...
 
struct  ref_count_deleter
 A deleter functor for creating std::unique_ptr that unrefs objects. More...
 
class  ref_count_ptr
 A smart pointer that holds a reference-counted object and releases it on destruction. More...
 

Functions

template<typename T >
std::unique_ptr< T, ref_count_deleterget_new_ref (T *ptr)
 Adds a new reference to a counted_base pointer.
 

Function Documentation

◆ get_new_ref()

template<typename T >
std::unique_ptr< T, ref_count_deleter > base::core::get_new_ref ( T ptr)

Adds a new reference to a counted_base pointer.

Template Parameters
TType of the object.
Parameters
ptrPointer to the object.
Returns
A smart pointer holding the reference to the object.