C++ API Reference for Intel® Data Analytics Acceleration Library 2020 Update 1

Classes | Functions
Managing Memory

Contains classes that implement memory allocation and deallocation. More...

Classes

class  BufferView< T >
 Class that refers to a contiguous sequence of objects, but doesn't control allocated memory buffer and objects lifetime, user is responsible for correct memory management and deallocation. More...
 
class  Collection< T >
 Class that implements functionality of the Collection container. More...
 
class  Atomic< dataType >
 Class that represents an atomic object. More...
 
class  DeleterIface
 Interface for a utility class used within SharedPtr to delete an object when the object owner is destroyed. More...
 
class  ObjectDeleter< T >
 Implementation of DeleterIface to destroy a pointer by the delete operator. More...
 
class  ServiceDeleter
 Implementation of DeleterIface to destroy a pointer by the daal_free function. More...
 
class  EmptyDeleter
 Implementation of DeleterIface without pointer destroying. More...
 
class  RefCounter
 Implementation of reference counter. More...
 
class  RefCounterImp< Deleter >
 Provides implementations of the operator() method of the RefCounter class. More...
 
class  SharedPtr< T >
 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  String
 Class that implements functionality of the string, an object that represents a sequence of characters. More...
 
class  StringView
 Class that implements functionality of the string but doesn't manage provided memory, user is responsible for correct memory management and deallocation. More...
 
class  Buffer< T >
 Class that provides simple memory management routines for handling blocks of continues memory, also provides automatic memory deallocation. Note this class doesn't provide functionality for objects constructions and simply allocates and deallocates memory. In case of objects consider Collection or ObjectPtrCollection. More...
 

Functions

template<class T , class U >
SharedPtr< T > staticPointerCast (const SharedPtr< U > &r)
 
template<class T , class U >
SharedPtr< T > reinterpretPointerCast (const SharedPtr< U > &r)
 
template<class T , class U >
SharedPtr< T > dynamicPointerCast (const SharedPtr< U > &r)
 
template<class U >
 SharedPtr (const SharedPtr< U > &other)
 
template<class U >
 SharedPtr (const SharedPtr< U > &r, T *ptr, T *shiftedPtr)
 
void _remove ()
 
SharedPtr< T > & operator= (const SharedPtr< T > &ptr)
 
template<class U >
void reset (U *ptr)
 
template<class U , class D >
void reset (U *ptr, const D &deleter)
 
DAAL_EXPORT void * daal_malloc (size_t size, size_t alignment=DAAL_MALLOC_DEFAULT_ALIGNMENT)
 
DAAL_EXPORT void * daal_calloc (size_t size, size_t alignment=DAAL_MALLOC_DEFAULT_ALIGNMENT)
 
DAAL_EXPORT void daal_free (void *ptr)
 
DAAL_DEPRECATED DAAL_EXPORT void daal_memcpy_s (void *dest, size_t numberOfElements, const void *src, size_t count)
 

Function Documentation

void _remove ( )
protected

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

DAAL_EXPORT void* daal::services::daal_calloc ( size_t  size,
size_t  alignment = DAAL_MALLOC_DEFAULT_ALIGNMENT 
)

Allocates and initializes with zero an aligned block of memory

Parameters
[in]sizeSize of the block of memory in bytes
[in]alignmentAlignment constraint. Must be a power of two
Returns
Pointer to the beginning of a newly allocated zero-filled block of memory
DAAL_EXPORT void daal::services::daal_free ( void *  ptr)

Deallocates the space previously allocated by daal_malloc

Parameters
[in]ptrPointer to the beginning of a block of memory to deallocate
DAAL_EXPORT void* daal::services::daal_malloc ( size_t  size,
size_t  alignment = DAAL_MALLOC_DEFAULT_ALIGNMENT 
)

Allocates an aligned block of memory

Parameters
[in]sizeSize of the block of memory in bytes
[in]alignmentAlignment constraint. Must be a power of two
Returns
Pointer to the beginning of a newly allocated block of memory
DAAL_DEPRECATED DAAL_EXPORT void daal::services::daal_memcpy_s ( void *  dest,
size_t  numberOfElements,
const void *  src,
size_t  count 
)

Copies bytes between buffers

Parameters
[out]destPointer to new buffer
[in]numberOfElementsSize of new buffer
[in]srcPointer to source buffer
[in]countNumber of bytes to copy.
Deprecated:
This item will be removed in a future release.
SharedPtr<T> daal::services::interface1::dynamicPointerCast ( const SharedPtr< U > &  r)

Creates a new instance of SharedPtr whose managed object type is obtained from the type of the managed object of r using a cast expression. Both shared pointers share ownership of the managed object. The managed object of the resulting SharedPtr is obtained by calling dynamic_cast<T*>(r.get()).

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

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

Parameters
[in]ptrShared pointer to copy
SharedPtr<T> daal::services::interface1::reinterpretPointerCast ( const SharedPtr< U > &  r)

Creates a new instance of SharedPtr whose managed object type is obtained from the type of the managed object of r using a cast expression. Both shared pointers share ownership of the managed object. The managed object of the resulting SharedPtr is obtained by calling reinterpret_cast<T*>(r.get()).

void reset ( U *  ptr)

Releases managed pointer, takes an ownership of ptr with default deleter

Template Parameters
UClass of the managed object
Parameters
[in]ptrPointer to the managed object
void reset ( U *  ptr,
const D &  deleter 
)

Releases managed pointer, takes an ownership of ptr with deleter D

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 ( const SharedPtr< U > &  other)

Constructs a shared pointer from another shared pointer of the same type

Parameters
[in]otherInput shared pointer
SharedPtr ( const SharedPtr< U > &  r,
T *  ptr,
T *  shiftedPtr 
)

Aliasing constructor: constructs a SharedPtr that shares ownership information with r, but holds an unrelated and unmanaged ptr pointer. Even if this SharedPtr is the last of the group to go out of scope, it calls the destructor for the object originally managed by r. However, calling get() on this always returns a copy of ptr. It is the responsibility of a programmer to make sure this ptr remains valid as long as this SharedPtr exists, such as in the typical use cases where ptr is a member of the object managed by r or is an alias (e.g., downcast) of r.get()

SharedPtr<T> daal::services::interface1::staticPointerCast ( const SharedPtr< U > &  r)

Creates a new instance of SharedPtr whose managed object type is obtained from the type of the managed object of r using a cast expression. Both shared pointers share ownership of the managed object. The managed object of the resulting SharedPtr is obtained by calling static_cast<T*>(r.get()).

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