NAME
OTC_RCount -
An integer count which also contains a reference count.
SYNOPSIS
#include <OTC/refcnt/rcount.hh>
class OTC_RCount : public OTC_Resource
{
public:
static os_typespec* get_os_typespec();
~OTC_RCount();
inline OTC_RCount();
inline OTC_RCount(OTC_RCount const& theCtr);
inline OTC_RCount& operator=(OTC_RCount const& theCtr);
inline void inc();
inline void dec();
inline void set(u_int theCount);
inline u_int count() const;
};
CLASS TYPE
Concrete
DESCRIPTION
OTC_RCount contains an integer count. It has a lower
bound of 0 and an upper bound of the largest number which
can be held in a u_int. When created, the count is set
to the lower bound of 0.
CONSTRUCTION
inline OTC_RCount();
Initialises the count to the lower bound
of 0.
inline OTC_RCount(OTC_RCount const& theCtr);
Initialises the count to the same
value as theCtr.
ASSIGNMENT
inline OTC_RCount& operator=(OTC_RCount const& theCtr);
Sets the count to the same value as
theCtr.
MODIFIERS
inline void inc();
Increments the current count by one.
inline void dec();
Decrements the current count by one. If
the counter is already at 0, the
value is unchanged.
inline void set(u_int theCount);
Sets the count to theCount.
QUERY
inline u_int count() const;
Returns the current count.
NOTES
No check is made against the upper bound, if the count was
incremented that far, it would quitely wrap around to 0.
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED