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...
template<class T>
class daal::services::interface1::SharedPtr< T >
- Template Parameters
-
T | Class of the managed object |
Constructs an empty shared pointer
Constructs a shared pointer that manages an input pointer
- Parameters
-
Constructs a shared pointer that manages an input pointer
- Template Parameters
-
U | Class of the managed object |
D | Class of the deleter object |
- Parameters
-
[in] | ptr | Pointer to the managed object |
[in] | deleter | Object used to delete the pointer when the reference count becomes equal to zero |
Decreases the reference count If the reference count becomes equal to zero, deletes the managed pointer
Returns a pointer to a managed object
- Returns
- Pointer to the managed object
Returns a pointer to the beginning of owned memory
- Returns
- Pointer to the beginning of owned memory
Checks if the managed pointer is not null
- Returns
- true if the managed pointer is not null
Dereferences a pointer to a managed object
- Returns
- Reference to the managed object
Dereferences a pointer to a managed object
- Returns
- Pointer to the managed object
Makes a copy of an input shared pointer and increments the reference count
- Parameters
-
[in] | ptr | Shared pointer to copy |
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: