ADTF  v2.14.3
cAtomicCounter Class Reference

This helper class can be used as an atomic integer counter variable. More...

Public Member Functions

 cAtomicCounter ()
 Default constructor. More...
 
 cAtomicCounter (tInt32 nInitial)
 Constructor with initial value. More...
 
tInt32 operator++ ()
 Increments the counter. More...
 
tInt32 operator++ (int)
 Increments the counter. More...
 
tInt32 operator-- ()
 Decrements the counter. More...
 
tInt32 operator-- (int)
 Decrements the counter. More...
 
tInt32 operator+= (tInt32 nValue)
 Increments the counter. More...
 
tInt32 operator-= (tInt32 nValue)
 Decrements the counter. More...
 
tInt32 operator= (tInt32 nValue)
 Sets a new counter value. More...
 
bool operator== (tInt32 nValue) const
 Checks whether the counter has a specific value. More...
 
 operator tInt32 () const
 Converts the counter to an integer. More...
 

Detailed Description

This helper class can be used as an atomic integer counter variable.

It offers the increment, decrement and addition operators, which are performed as atomic non blocking operations.

Definition at line 147 of file atomic.h.

Constructor & Destructor Documentation

cAtomicCounter ( )
inline

Default constructor.

This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 156 of file atomic.h.

cAtomicCounter ( tInt32  nInitial)
inlineexplicit

Constructor with initial value.

Parameters
[in]nInitialThe initial value of the counter.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 163 of file atomic.h.

Member Function Documentation

operator tInt32 ( ) const
inline

Converts the counter to an integer.

This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 255 of file atomic.h.

tInt32 operator++ ( )
inline

Increments the counter.

Returns
The new counter value;
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 172 of file atomic.h.

References adtf_util::AtomicIncrement().

tInt32 operator++ ( int  )
inline

Increments the counter.

Returns
The old counter value.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 182 of file atomic.h.

References adtf_util::AtomicIncrement().

tInt32 operator+= ( tInt32  nValue)
inline

Increments the counter.

Parameters
nValue[in] By how much the counter should be increased.
Returns
The new counter value.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 213 of file atomic.h.

References adtf_util::AtomicAdd().

tInt32 operator-- ( )
inline

Decrements the counter.

Returns
The new counter value.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 192 of file atomic.h.

References adtf_util::AtomicDecrement().

tInt32 operator-- ( int  )
inline

Decrements the counter.

Returns
The old counter value.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 202 of file atomic.h.

References adtf_util::AtomicDecrement().

tInt32 operator-= ( tInt32  nValue)
inline

Decrements the counter.

Parameters
nValue[in] By how much the counter should be decremented.
Returns
The new counter value.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 224 of file atomic.h.

References adtf_util::AtomicAdd().

tInt32 operator= ( tInt32  nValue)
inline

Sets a new counter value.

Parameters
nValue[in] The new value.
Returns
The new value.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 235 of file atomic.h.

bool operator== ( tInt32  nValue) const
inline

Checks whether the counter has a specific value.

Parameters
nValue[in] The value to compare to
Returns
true if the values match, otherwise false.
This method is real-time safe.
See The ADTF Real-Time Extension.

Definition at line 246 of file atomic.h.


Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Fri Mar 22 2019 by doxygen 1.8.10)