libqi-api  2.4.3.28
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
qi::Atomic< T > Struct Template Reference

#include <atomic.hpp>

Public Member Functions

 Atomic ()
 
 Atomic (T value)
 
 Atomic (const Atomic &other)
 
T operator++ ()
 Atomic increment of the value. More...
 
T operator-- ()
 Atomic decement of the value. More...
 
Atomic< T > & operator= (T value)
 
Atomic< T > & operator= (const Atomic< T > &value)
 
bool setIfEquals (T testValue, T setValue)
 
T swap (T value)
 
T operator* () const
 

Public Attributes

boost::atomic< T > _value
 

Detailed Description

template<typename T>
struct qi::Atomic< T >

Atomic operations on integrals.

This class allows to do operations on an integral value from multiple threads, with the guarantee that each operation will not lead to a data race.

Definition at line 140 of file atomic.hpp.

Constructor & Destructor Documentation

template<typename T>
qi::Atomic< T >::Atomic ( )
inline

Definition at line 147 of file atomic.hpp.

template<typename T>
qi::Atomic< T >::Atomic ( T  value)
inline

Atomic constructor setting value to its parameter.

Parameters
valueThe default value of the atomic.

Definition at line 153 of file atomic.hpp.

template<typename T>
qi::Atomic< T >::Atomic ( const Atomic< T > &  other)
inline

Definition at line 159 of file atomic.hpp.

Member Function Documentation

template<typename T>
T qi::Atomic< T >::operator* ( ) const
inline

Return the contained value

Definition at line 189 of file atomic.hpp.

template<typename T>
T qi::Atomic< T >::operator++ ( )
inline

Atomic increment of the value.

Definition at line 164 of file atomic.hpp.

template<typename T>
T qi::Atomic< T >::operator-- ( )
inline

Atomic decement of the value.

Definition at line 167 of file atomic.hpp.

template<typename T>
Atomic<T>& qi::Atomic< T >::operator= ( T  value)
inline

Definition at line 170 of file atomic.hpp.

template<typename T>
Atomic<T>& qi::Atomic< T >::operator= ( const Atomic< T > &  value)
inline

Definition at line 172 of file atomic.hpp.

template<typename T>
bool qi::Atomic< T >::setIfEquals ( T  testValue,
T  setValue 
)
inline

If value is testValue, replace it with setValue.

Returns
true if swap was performed

Definition at line 178 of file atomic.hpp.

template<typename T>
T qi::Atomic< T >::swap ( T  value)
inline

Swap the atomic value with value.

Returns
the previously held value

Definition at line 184 of file atomic.hpp.

Member Data Documentation

template<typename T>
boost::atomic<T> qi::Atomic< T >::_value

Definition at line 143 of file atomic.hpp.


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