class ref_counter_pool

class for maintaining the storage of counters used by ref_ptr. More...

Definition#include <ref_ptr.hh>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods


Detailed Description

The ref_counter_pool is a singleton class that maintains the counters for all ref_ptr objects. The counters are maintained in a vector. This class is used by ref_ptr and not intended any other purpose.

int32_t  new_counter ()

new_counter

Create a new counter.

Returns: index associated with counter.

int32_t  incr_counter (int32_t index)

incr_counter

Increment the count associated with counter by 1.

Parameters:
indexthe counter to increment.

int32_t  decr_counter (int32_t index)

decr_counter

Decrement the count associated with counter by 1.

Parameters:
indexthe counter to decrement.

int32_t  count (int32_t index)

count

Get the count associated with counter.

Parameters:
indexof the counter to query.

Returns: the counter value.

void  recycle (int32_t index)

recycle

Recycle counter. Places counter on free-list.

Parameters:
indexof the counter to recycle.

void  dump ()

dump

Dumps counter info to stdout. Debugging function.

void  check ()

check

Sanity check internal data structure. Debugging function.

bool  on_free_list (int32_t index)

on_free_list

Check index is on free list.

inline int32_t  balance ()

balance

[const]

Return number of valid ref pointer entries in pool.

ref_counter_pool&  instance ()

instance

[static]

Returns: singleton ref_counter_pool.

 ref_counter_pool ()

ref_counter_pool


Generated by: pavlin on possum.icir.org on Thu Aug 28 12:51:57 2003, using kdoc 2.0a54+XORP.