Smart Pointer. More...
#include <rshareddata.h>
Public Member Functions | |
RSmartPtr (void) | |
RSmartPtr (C *ptr) | |
RSmartPtr (const RSmartPtr &ptr) | |
RSmartPtr & | operator= (const RSmartPtr &ptr) |
C * | operator-> () const |
C & | operator* () const |
~RSmartPtr (void) | |
Private Member Functions | |
void | Init (void) |
Private Attributes | |
C * | Ptr |
Detailed Description
template<class C>
class R::RSmartPtr< C >
Smart Pointer.
The RSmartPtr represent a smart pointer of a given type which must inherits from RSharedData.
- Template Parameters
-
C Class pointed. It is an implementation of Scott Meyers proposition in "MORE EFFECTIVE C++".
Constructor & Destructor Documentation
RSmartPtr | ( | void | ) |
Default constructor.
RSmartPtr | ( | C * | ptr | ) |
Constructor.
- Parameters
-
ptr Pointer to the object.
~RSmartPtr | ( | void | ) |
Destructor.
Member Function Documentation
|
private |
Method called by all constructors.
Assignment operator.
- Parameters
-
ptr Original smart pointer.
C* operator-> | ( | ) | const |
The -> operator.
C& operator* | ( | ) | const |
The * operator.
Field Documentation
|
private |
Pointer.