Implementation of a shared pointer handle.The SharedPtr class is a RAII class for resource management similar to the std::tr1::shared_ptr class. However, SharedPtr offers only a limited functionality for the purpose of the physics engine.
More...
#include <SharedPtr.h>
|
typedef Type | ElementType |
| Type of the wrapped element.
|
|
typedef Type * | Pointer |
| Pointer return type and type of the underlying pointer.
|
|
typedef Type & | Reference |
| Reference return type.
|
|
template<typename Type>
class blaze::SharedPtr< Type >
Implementation of a shared pointer handle.
The SharedPtr class is a RAII class for resource management similar to the std::tr1::shared_ptr class. However, SharedPtr offers only a limited functionality for the purpose of the physics engine.
Default constructor for SharedPtr.
A default constructed shared pointer is not bound to any object.
template<typename Type >
template<typename Other >
Binding an object to a shared pointer.
- Parameters
-
ptr | Pointer to the object to be bound to the shared pointer. |
This SharedPtr constructor binds the given object to a shared pointer. All shared pointers originating from this shared pointers will refer to the same bound object. If the last shared pointer goes out of scope, the bound object is destroyed.
Copy constructor for SharedPtr.
- Parameters
-
ptr | The shared pointer to be copied. |
The copy constructor creates a new shared pointer bound to the same object as the original shared pointer.
template<typename Type >
template<typename Other >
Conversion constructor from different SharedPtr instances.
- Parameters
-
ptr | The shared pointer to be copied. |
This constructor creates a new shared pointer bound to the same object as the original shared pointer.
Returns a reference to the bound object.
- Returns
- Reference to the bound object.
Returns a pointer to the bound object.
- Returns
- Pointer to the bound object.
Copy assignment operator for SharedPtr.
- Parameters
-
ptr | The shared pointer to be copied. |
- Returns
- Reference to the assigned shared pointer.
The copy assignment operator binds this shared pointer to the object in the given shared pointer. If this shared pointer is the last reference to the object bound by this shared pointer, the object will be destroyed.
template<typename Type>
template<typename Other >
Assignment operator for different instances of SharedPtr.
- Parameters
-
ptr | The shared pointer to be copied. |
- Returns
- Reference to the assigned shared pointer.
The copy assignment operator binds this shared pointer to the object in the given shared pointer. If this shared pointer is the last reference to the object bound by this shared pointer, the object will be destroyed.
Swapping the contents of two shared pointers.
- Parameters
-
ptr | The shared pointer to be swapped. |
- Returns
- void
- Exceptions
-
The documentation for this class was generated from the following file: