C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 2

List of all members
SharedPtr< T > Class Template Reference

Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr objects may own the same object. The object is destroyed and its memory deallocated when either of the following happens:
1) the last remaining SharedPtr owning the object is destroyed.
2) the last remaining SharedPtr owning the object is assigned another pointer via operator=.
The object is destroyed using the delete operator. More...

Class Declaration

template<class T>
class daal::services::interface1::SharedPtr< T >

Template Parameters
TClass of the managed object

Constructor & Destructor Documentation

◆ SharedPtr() [1/3]

SharedPtr ( )
inline

Constructs an empty shared pointer

◆ SharedPtr() [2/3]

SharedPtr ( U *  ptr)
inlineexplicit

Constructs a shared pointer that manages an input pointer

Parameters
[in]ptrPointer to manage

◆ SharedPtr() [3/3]

SharedPtr ( U *  ptr,
const D &  deleter 
)
inlineexplicit

Constructs a shared pointer that manages an input pointer

Template Parameters
UClass of the managed object
DClass of the deleter object
Parameters
[in]ptrPointer to the managed object
[in]deleterObject used to delete the pointer when the reference count becomes equal to zero

◆ ~SharedPtr()

~SharedPtr ( )
inline

Decreases the reference count If the reference count becomes equal to zero, deletes the managed pointer

Member Function Documentation

◆ get()

T* get ( ) const
inline

Returns a pointer to a managed object

Returns
Pointer to the managed object

◆ getStartPtr()

T* getStartPtr ( ) const
inline

Returns a pointer to the beginning of owned memory

Returns
Pointer to the beginning of owned memory

◆ operator bool()

operator bool ( ) const
inline

Checks if the managed pointer is not null

Returns
true if the managed pointer is not null

◆ operator*()

T& operator* ( ) const
inline

Dereferences a pointer to a managed object

Returns
Reference to the managed object

◆ operator->()

T* operator-> ( ) const
inline

Dereferences a pointer to a managed object

Returns
Pointer to the managed object

◆ operator=()

SharedPtr<T>& operator= ( const SharedPtr< U > &  ptr)
inline

Makes a copy of an input shared pointer and increments the reference count

Parameters
[in]ptrShared pointer to copy

◆ reset()

void reset ( )
inline

Releases managed pointer

◆ useCount()

int useCount ( ) const
inline

Returns the number of shared_ptr objects referring to the same managed object

Returns
The number of shared_ptr objects referring to the same managed object

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

For more complete information about compiler optimizations, see our Optimization Notice.