ders::sh_ptr< T > Class Template Reference
Shared smart pointer that uses
destroy() function to destruct passed objects.
More...
#include <sh_ptr.hpp>
List of all members.
Detailed Description
template<class T>
class ders::sh_ptr< T >
Shared smart pointer that uses
destroy() function to destruct passed objects.
Definition at line 41 of file sh_ptr.hpp.
Constructor & Destructor Documentation
Definition at line 82 of file sh_ptr.hpp.
00083 {
00084 try { cr=new(mp.allocate(sizeof(core))) core(mp, ptr); }
00085 catch (...) {
00086 destroy(ptr, mp);
00087 throw;
00088 }
00089 }
Definition at line 48 of file sh_ptr.hpp.
00049 {
00050 cr=shp.cr;
00051 cr->refs++;
00052 }
Definition at line 92 of file sh_ptr.hpp.
00093 {
00094 if (--cr->refs==0) destroy(cr, cr->mp);
00095 }
Member Function Documentation
Definition at line 98 of file sh_ptr.hpp.
00099 {
00100 shp.cr->refs++;
00101 if (--cr->refs==0) destroy(cr, cr->mp);
00102 cr=shp.cr;
00103
00104 return *this;
00105 }
Definition at line 60 of file sh_ptr.hpp.
00061 {
00062 core* tmp=cr;
00063 cr=shp.cr;
00064 shp.cr=tmp;
00065 }
Definition at line 67 of file sh_ptr.hpp.
00067 { return *cr->ptr; }
Definition at line 68 of file sh_ptr.hpp.
00068 { return *cr->ptr; }
Definition at line 70 of file sh_ptr.hpp.
00070 { return cr->ptr; }
Definition at line 71 of file sh_ptr.hpp.
00071 { return cr->ptr; }
Definition at line 73 of file sh_ptr.hpp.
00073 { return cr->ptr; }
Definition at line 74 of file sh_ptr.hpp.
00074 { return cr->ptr; }
Definition at line 78 of file sh_ptr.hpp.
00078 { return cr->refs; }
The documentation for this class was generated from the following file: