Yate: TempObjectCounter Class Reference

Yate

Public Member Functions | List of all members
TempObjectCounter Class Reference

Ephemeral object counter changer. More...

`#include <yateclass.h>`

## Public Member Functions
| TempObjectCounter (NamedCounter *counter, bool enable=GenObject::getObjCounting())
| TempObjectCounter (const GenObject *obj, bool enable=GenObject::getObjCounting())
| TempObjectCounter (const GenObject &obj, bool enable=GenObject::getObjCounting())
| ~TempObjectCounter ()

## Detailed Description

Ephemeral object counter changer.

This class changes the current thread's object counter for its lifetime

## Constructor & Destructor Documentation

## ◆ TempObjectCounter() [1/3]

TempObjectCounter | ( | NamedCounter * | counter,
|  | bool | enable = GenObject::getObjCounting() )
| inline

Constructor, changes object counter if counting is enabled

Parameters

  counter | Object counter to apply on the current thread
  enable | True to enable change, false to take no action

References Thread::setCurrentObjCounter().

## ◆ TempObjectCounter() [2/3]

TempObjectCounter | ( | const GenObject * | obj,
|  | bool | enable = GenObject::getObjCounting() )
| inline

Constructor, changes object counter if counting is enabled

Parameters

  obj | Object to copy the counter from
  enable | True to enable change, false to take no action

References GenObject::getObjCounter(), and Thread::setCurrentObjCounter().

## ◆ TempObjectCounter() [3/3]

TempObjectCounter | ( | const GenObject & | obj,
|  | bool | enable = GenObject::getObjCounting() )
| inline

Constructor, changes object counter if counting is enabled

Parameters

  obj | Object to copy the counter from
  enable | True to enable change, false to take no action

References GenObject::getObjCounter(), and Thread::setCurrentObjCounter().

## ◆ ~TempObjectCounter()

~TempObjectCounter | ( |  | ) |
| inline

Destructor, restores saved object counter

References Thread::setCurrentObjCounter().

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

- yateclass.h