Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
stxxl::shared_object Class Reference

Provides reference counting abilities for use with shared_object_pointer. More...

#include <shared_object.h>

Inheritance diagram for stxxl::shared_object:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 shared_object ()
 shared_object (const shared_object &)
const shared_objectoperator= (const shared_object &) const
shared_objectoperator= (const shared_object &)
 ~shared_object ()

Private Member Functions

void new_reference () const
 Call whenever setting a pointer to the object.
bool delete_reference () const
 Call whenever resetting (i.e. overwriting) a pointer to the object. IMPORTANT: In case of self-assignment, call AFTER new_reference().
bool unique () const
 if the shared_object is referenced by only one shared_object_pointer

Private Attributes

int reference_count

Detailed Description

Provides reference counting abilities for use with shared_object_pointer.

Use as superclass of the actual object. Then either use shared_object_pointer as pointer to manage references and deletion, or just do normal new and delete.

Definition at line 196 of file shared_object.h.


Constructor & Destructor Documentation

Definition at line 201 of file shared_object.h.

Definition at line 204 of file shared_object.h.

Definition at line 213 of file shared_object.h.


Member Function Documentation

bool stxxl::shared_object::delete_reference ( ) const [inline, private]

Call whenever resetting (i.e. overwriting) a pointer to the object. IMPORTANT: In case of self-assignment, call AFTER new_reference().

Returns:
if the object has to be deleted (i.e. if it's reference count dropped to zero)

Definition at line 226 of file shared_object.h.

void stxxl::shared_object::new_reference ( ) const [inline, private]

Call whenever setting a pointer to the object.

Definition at line 220 of file shared_object.h.

const shared_object& stxxl::shared_object::operator= ( const shared_object ) const [inline]

Definition at line 207 of file shared_object.h.

shared_object& stxxl::shared_object::operator= ( const shared_object ) [inline]

Definition at line 210 of file shared_object.h.

bool stxxl::shared_object::unique ( ) const [inline, private]

if the shared_object is referenced by only one shared_object_pointer

Definition at line 230 of file shared_object.h.


Member Data Documentation

int stxxl::shared_object::reference_count [mutable, private]

Definition at line 198 of file shared_object.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines