Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

stdx::auto_ref_ptr< C > Class Template Reference

#include <cpputils.h>

List of all members.


Detailed Description

template<class C>
class stdx::auto_ref_ptr< C >

The auto_ref_ptr template manages pointers to objects that support reference counting by implementing auto_ref or a similar interface.

Pointer management includes the following key points:

1) Automatic increment of the object's reference counter when the given auto_ref_ptr instance starts managing a pointer to this object.

2) Automatic decrement of the reference counter when the given auto_ref_ptr instance is destroyed, or before it is assigned a pointer to a new object.

3) Automatic deletion of the managed object whenever its reference counter reaches zero after a decrement.

4) Providing the dereference operator-> that gives direct access to the managed pointer.

The object class to manage must provide ref() and unref() methods that have the same syntax and semantics as defined in the auto_ref class.

Parameters:
C Class to manage.

Definition at line 133 of file cpputils.h.


Public Member Functions

 auto_ref_ptr (const auto_ref_ptr &that)
 auto_ref_ptr (C *a)
 auto_ref_ptr ()
bool is_null () const
C * operator-> () const
auto_ref_ptroperator= (const auto_ref_ptr &that)
auto_ref_ptroperator= (C *a)
bool operator== (const auto_ref_ptr &that) const
C * raw () const

Protected Member Functions

void do_reref (C *a)
void do_unref ()

Protected Attributes

C * m

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

Generated by  Doxygen 1.6.0   Back to index