CS::Utility::FastRefCount< ActualClass > Class Template Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
CS::Utility::FastRefCount< ActualClass > Class Template Reference

This is a class which provides basic reference-counting semantics. More...

`#include <csutil/refcount.h>`

List of all members.

## Public Member Functions
void | DecRef ()
| Decrease the number of references to this object.
int | GetRefCount () const
| Get the reference count (only for debugging).
void | IncRef ()
| Increase the number of references to this object.
| FastRefCount ()
| Initialize object and set reference to 1.
| FastRefCount (const FastRefCount &other)
| Initialize object and set reference to 1.

## Detailed Description

### template<typename ActualClass>
class CS::Utility::FastRefCount< ActualClass >

This is a class which provides basic reference-counting semantics.

It can be used in conjunction with the smart pointer template class csRef (see <ref.h>). This class itself provides no functionality beyond reference counting. It is intended that you should subclass FastRefCount and add needed functionality.

This class has slightly less overhead than csRefCount, but is also less generally useable:

- Pointers can *not* be passed across plugin boundaries.
- Deriving from a class C derived from ActualClass without using a virtual destructor in C can lead to the wrong destructor being called.
- Using virtual methods eliminates the overhead advantage.

Definition at line 108 of file refcount.h.

## Constructor & Destructor Documentation

template<typename ActualClass>

CS::Utility::FastRefCount< ActualClass >::FastRefCount | ( |  | ) | `[inline]`

Initialize object and set reference to 1.

Definition at line 121 of file refcount.h.

template<typename ActualClass>

CS::Utility::FastRefCount< ActualClass >::FastRefCount | ( | const FastRefCount< ActualClass > & | other | ) | `[inline]`

Initialize object and set reference to 1.

Definition at line 125 of file refcount.h.

## Member Function Documentation

template<typename ActualClass>

void CS::Utility::FastRefCount< ActualClass >::DecRef | ( |  | ) | `[inline]`

Decrease the number of references to this object.

Definition at line 138 of file refcount.h.

template<typename ActualClass>

int CS::Utility::FastRefCount< ActualClass >::GetRefCount | ( |  | ) | const`[inline]`

Get the reference count (only for debugging).

Definition at line 146 of file refcount.h.

template<typename ActualClass>

void CS::Utility::FastRefCount< ActualClass >::IncRef | ( |  | ) | `[inline]`

Increase the number of references to this object.

Definition at line 132 of file refcount.h.

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

- csutil/refcount.h