# class NamedCounter | Atomic counter with name. More...
Full name | `TelEngine::NamedCounter`
Definition | `#include <yateclass.h>`
Inherits | TelEngine::String [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- explicit NamedCounter (const String& name)
- inline bool enabled () const
- inline void enable (bool val)
- int inc ()
- int dec ()
- inline int count () const

## Detailed Description

An atomic counter with an associated name

explicit NamedCounter (const String& name) | ### NamedCounter

Constructor

Parameters:

name | Name of the counter

inline bool enabled () | ### enabled

[const]

Check if the counter is enabled

Returns: True if the counter is enabled

inline void enable (bool val) | ### enable

Enable or disable the counter

Parameters:

val | True to enable counter, false to disable

int inc () | ### inc

Increment the counter

Returns: Post-increment value of the counter

int dec () | ### dec

Decrement the counter

Returns: Post-decrement value of the counter

inline int count () | ### count

[const]

Get the current value of the counter

Returns: Value of the counter

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.