Predator  [unstable] git snapshot
Public Member Functions | Private Types | Private Attributes
RefCounter Class Reference

#include <syments.hh>

Public Member Functions

 RefCounter ()
 initialize to 1
 RefCounter (const RefCounter &)
 initialize to 1, even if the source has another value
RefCounteroperator= (const RefCounter &)
 initialize to 1, even if the source has another value
 ~RefCounter ()
 the destruction is only allowed with reference count equal to zero
bool isShared () const
bool enter ()
bool requireExclusivity ()
bool leave ()

Private Types

typedef int TCnt

Private Attributes

TCnt cnt_

Detailed Description

Definition at line 37 of file syments.hh.

Member Typedef Documentation

typedef int TCnt
private

Definition at line 39 of file syments.hh.

Constructor & Destructor Documentation

RefCounter ( )
inline

initialize to 1

Definition at line 44 of file syments.hh.

RefCounter ( const RefCounter )
inline

initialize to 1, even if the source has another value

Definition at line 50 of file syments.hh.

~RefCounter ( )
inline

the destruction is only allowed with reference count equal to zero

Definition at line 62 of file syments.hh.

References CL_BREAK_IF, and cnt_.

Member Function Documentation

bool enter ( )
inline

Definition at line 71 of file syments.hh.

References CL_BREAK_IF, and cnt_.

bool isShared ( ) const
inline

Definition at line 66 of file syments.hh.

References CL_BREAK_IF, and cnt_.

Referenced by requireExclusivity().

bool leave ( )
inline

Definition at line 85 of file syments.hh.

References cnt_.

RefCounter& operator= ( const RefCounter )
inline

initialize to 1, even if the source has another value

Definition at line 56 of file syments.hh.

References cnt_.

bool requireExclusivity ( )
inline

Definition at line 77 of file syments.hh.

References cnt_, and isShared().

Field Documentation

TCnt cnt_
private

Definition at line 40 of file syments.hh.

Referenced by enter(), isShared(), leave(), operator=(), requireExclusivity(), and ~RefCounter().


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