claw 1.9.0
 
Loading...
Searching...
No Matches
claw::memory::smart_ptr< T > Class Template Reference

A pointer with a reference counter. More...

#include <smart_ptr.hpp>

Public Types

typedef T value_type
 The type of the pointed data.
 
typedef smart_ptr< value_typeself_type
 The type of the current class.
 
typedef T & reference
 Reference on the type of the stored data.
 
typedef T * pointer
 Pointer on the type of the stored data.
 
typedef const T & const_reference
 Constant reference on the type of the stored data.
 
typedef const T *const const_pointer
 Constant pointer on the type of the stored data.
 

Public Member Functions

 smart_ptr (pointer data)
 
 smart_ptr (const self_type &that)
 
self_typeoperator= (const self_type &that)
 
bool operator== (const self_type &that) const
 
bool operator!= (const self_type &that) const
 
bool operator< (const self_type &that) const
 
bool operator<= (const self_type &that) const
 
bool operator> (const self_type &that) const
 
bool operator>= (const self_type &that) const
 
pointer operator-> ()
 
pointer operator-> () const
 
reference operator* ()
 
reference operator* () const
 

Detailed Description

template<typename T>
class claw::memory::smart_ptr< T >

A pointer with a reference counter.

Smart pointers allow the user to stop caring about the release of dynamically allocated memory. When no more pointers point to the allocated memory, this memory is released.

Template parameters:

  • T The type of the pointed data.
Author
Julien Jorge

Definition at line 51 of file smart_ptr.hpp.

Member Typedef Documentation

◆ const_pointer

template<typename T>
typedef const T* const claw::memory::smart_ptr< T >::const_pointer

Constant pointer on the type of the stored data.

Definition at line 70 of file smart_ptr.hpp.

◆ const_reference

template<typename T>
typedef const T& claw::memory::smart_ptr< T >::const_reference

Constant reference on the type of the stored data.

Definition at line 67 of file smart_ptr.hpp.

◆ pointer

template<typename T>
typedef T* claw::memory::smart_ptr< T >::pointer

Pointer on the type of the stored data.

Definition at line 64 of file smart_ptr.hpp.

◆ reference

template<typename T>
typedef T& claw::memory::smart_ptr< T >::reference

Reference on the type of the stored data.

Definition at line 61 of file smart_ptr.hpp.

◆ self_type

template<typename T>
typedef smart_ptr<value_type> claw::memory::smart_ptr< T >::self_type

The type of the current class.

Definition at line 58 of file smart_ptr.hpp.

◆ value_type

template<typename T>
typedef T claw::memory::smart_ptr< T >::value_type

The type of the pointed data.

Definition at line 55 of file smart_ptr.hpp.


The documentation for this class was generated from the following file: