Yate: YAtomicNumber< Type > Class Template Reference

Yate

Public Member Functions | Protected Attributes | List of all members
YAtomicNumber< Type > Class Template Reference

An atomic number. More...

`#include <yateclass.h>`

Inheritance diagram for YAtomicNumber< Type >:

## Public Member Functions
| YAtomicNumber ()
| YAtomicNumber (Type val)
| YAtomicNumber (const YAtomicNumber &val)
Type | value () const
Type | value ()
Type & | valueRef ()
Type | valueAtomic () const
Type | valueAtomic ()
Type | set (Type val)
Type | inc ()
Type | dec ()
Type | add (Type val)
Type | sub (Type val)
Type | bitAnd (Type val)
Type | bitOr (Type val)
Type | bitXor (Type val)
Type | preInc ()
Type | preDec ()
Type | preAdd (Type val)
Type | preSub (Type val)
Type | preBitAnd (Type val)
Type | preBitOr (Type val)
Type | preBitXor (Type val)
| operator Type ()
| operator Type () const
YAtomicNumber & | operator= (Type val)
YAtomicNumber & | operator= (const YAtomicNumber &val)
Type | operator+= (Type val)
Type | operator++ ()
Type | operator-- ()
Type | operator++ (int)
Type | operator-- (int)
Type | operator-= (Type val)
Type | operator&= (Type val)
Type | operator|= (Type val)
Type | operator^= (Type val)
Public Member Functions inherited from AtomicOp
| AtomicOp ()
RWLock * | lock () const

## Protected Attributes
Type | m_value
Protected Attributes inherited from AtomicOp
RWLock * | m_lock

## Additional Inherited Members
Static Public Member Functions inherited from AtomicOp
static bool | efficient ()

## Detailed Description

template<class Type>
class YAtomicNumber< Type >

An atomic number.

This class holds an atomic number along with operations on it

## Constructor & Destructor Documentation

## ◆ YAtomicNumber() [1/3]

template<class Type >

YAtomicNumber | ( |  | ) |
| inline

Default constructor

## ◆ YAtomicNumber() [2/3]

template<class Type >

YAtomicNumber | ( | Type | val | ) |
| inlineexplicit

Constructor

Parameters

  val | Initial value

## ◆ YAtomicNumber() [3/3]

template<class Type >

YAtomicNumber | ( | const YAtomicNumber< Type > & | val | ) |
| inlineexplicit

Copy constructor

Parameters

  val | Initial value

## Member Function Documentation

## ◆ add()

template<class Type >

Type add | ( | Type | val | ) |
| inline

Add a number to this one

Parameters

  val | Number to add

Returns
  Number after addition

## ◆ bitAnd()

template<class Type >

Type bitAnd | ( | Type | val | ) |
| inline

Bitwise AND

Parameters

  val | Value to apply

Returns
  Number after operation

## ◆ bitOr()

template<class Type >

Type bitOr | ( | Type | val | ) |
| inline

Bitwise OR

Parameters

  val | Value to apply

Returns
  Number after operation

## ◆ bitXor()

template<class Type >

Type bitXor | ( | Type | val | ) |
| inline

Bitwise XOR

Parameters

  val | Value to apply

Returns
  Number after operation

## ◆ dec()

template<class Type >

Type dec | ( |  | ) |
| inline

Decrement this number

Returns
  Number after decrement

## ◆ inc()

template<class Type >

Type inc | ( |  | ) |
| inline

Increment this number

Returns
  Number after increment

## ◆ operator Type() [1/2]

template<class Type >

operator Type | ( |  | ) |
| inline

Cast operator Return atomic value

## ◆ operator Type() [2/2]

template<class Type >

operator Type | ( |  | ) | const
| inline

Cast operator Return atomic value

## ◆ operator&=()

template<class Type >

Type operator&= | ( | Type | val | ) |
| inline

Bitwise AND operator

Parameters

  val | Number to apply

## ◆ operator++() [1/2]

template<class Type >

Type operator++ | ( |  | ) |
| inline

Prefix increment operator

## ◆ operator++() [2/2]

template<class Type >

Type operator++ | ( | int |  | ) |
| inline

Postfix increment operator

## ◆ operator+=()

template<class Type >

Type operator+= | ( | Type | val | ) |
| inline

Addition operator

Parameters

  val | Number to add

## ◆ operator--() [1/2]

template<class Type >

Type operator-- | ( |  | ) |
| inline

Prefix decrement operator

## ◆ operator--() [2/2]

template<class Type >

Type operator-- | ( | int |  | ) |
| inline

Postfix decrement operator

## ◆ operator-=()

template<class Type >

Type operator-= | ( | Type | val | ) |
| inline

Substraction operator

Parameters

  val | Number to substract

## ◆ operator=() [1/2]

template<class Type >

YAtomicNumber & operator= | ( | const YAtomicNumber< Type > & | val | ) |
| inline

Assignment operator

Parameters

  val | Number to set

## ◆ operator=() [2/2]

template<class Type >

YAtomicNumber & operator= | ( | Type | val | ) |
| inline

Assignment operator

Parameters

  val | Number to set

## ◆ operator^=()

template<class Type >

Type operator^= | ( | Type | val | ) |
| inline

Bitwise XOR operator

Parameters

  val | Number to apply

## ◆ operator|=()

template<class Type >

Type operator|= | ( | Type | val | ) |
| inline

Bitwise OR operator

Parameters

  val | Number to apply

## ◆ preAdd()

template<class Type >

Type preAdd | ( | Type | val | ) |
| inline

Add a number to this one

Parameters

  val | Number to add

Returns
  Number before addition

## ◆ preBitAnd()

template<class Type >

Type preBitAnd | ( | Type | val | ) |
| inline

Bitwise AND

Parameters

  val | Value to apply

Returns
  Number before operation

## ◆ preBitOr()

template<class Type >

Type preBitOr | ( | Type | val | ) |
| inline

Bitwise OR

Parameters

  val | Value to apply

Returns
  Number before operation

## ◆ preBitXor()

template<class Type >

Type preBitXor | ( | Type | val | ) |
| inline

Bitwise XOR

Parameters

  val | Value to apply

Returns
  Number before operation

## ◆ preDec()

template<class Type >

Type preDec | ( |  | ) |
| inline

Decrement this number

Returns
  Number before decrement

## ◆ preInc()

template<class Type >

Type preInc | ( |  | ) |
| inline

Increment this number

Returns
  Number before increment

## ◆ preSub()

template<class Type >

Type preSub | ( | Type | val | ) |
| inline

Substract a number from this one

Parameters

  val | Number to substract

Returns
  Number before substraction

## ◆ set()

template<class Type >

Type set | ( | Type | val | ) |
| inline

Replace (set a new) value

Parameters

  val | Value to set

Returns
  Old number value

## ◆ sub()

template<class Type >

Type sub | ( | Type | val | ) |
| inline

Substract a number from this one

Parameters

  val | Number to substract

Returns
  Number after substraction

## ◆ value() [1/2]

template<class Type >

Type value | ( |  | ) |
| inline

Retrieve held number

Returns
  Held number

## ◆ value() [2/2]

template<class Type >

Type value | ( |  | ) | const
| inline

Retrieve held number

Returns
  Held number

## ◆ valueAtomic() [1/2]

template<class Type >

Type valueAtomic | ( |  | ) |
| inline

Atomically retrieve held number

Returns
  Held number

## ◆ valueAtomic() [2/2]

template<class Type >

Type valueAtomic | ( |  | ) | const
| inline

Atomically retrieve held number

Returns
  Held number

## ◆ valueRef()

template<class Type >

Type & valueRef | ( |  | ) |
| inline

Retrieve held number reference

Returns
  Held number reference

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

- yateclass.h