API Reference > Other Classes > OdSharedPtr Template
OdSharedPtr Template
OdSharedPtr
Syntax
C++
template <class T> class OdSharedPtr;

SharedPtr.h

This template class implements SharedPointers for instances not derived from OdRxObject.

SharedPointers relieve the programmer of having to determine when objects are no longer needed, or having to delete them them at that time. 

Each object referenced by a SharedPointer (henceforth 'referenced object') has associated with it a reference count; i.e., how many SharedPointers are referencing it. When the reference count reaches zero, the referenced object is deleted. 

Corresponding C++ library: TD_Root

 
Name 
Description 
 
 
 
This is the overview for the OdSharedPtr constructor overload. 
 
Name 
Description 
 
Detaches referenced object from the pointer. Warning: this method may be used only if reference count is 1 (i.e. when this pointer is the single owner of the referenced object) 
 
get 
This is the overview for the get method overload. 
 
Returns true if and only if this SharedPointer contains a null reference. 
 
Returns the number of references to the object. 
 
Name 
Description 
 
* 
This is the overview for the * operator overload. 
 
= 
This is =, a member of class OdSharedPtr. 
 
-> 
This is the overview for the -> operator overload. 
 
This is const T*, a member of class OdSharedPtr. 
 
T* 
This is T*, a member of class OdSharedPtr. 
Copyright © 2002–2020. Open Design Alliance. All rights reserved.