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

Atomic operations on integers. More...

#include <atomic.hpp>

Public Member Functions

 Atomic ()
 Default atomic constructor, setting value to 0. More...
 
 Atomic (T value)
 Atomic constructor setting value to its parameter. More...
 
- Public Member Functions inherited from qi::AtomicBase< T >
operator++ ()
 
operator-- ()
 
AtomicBase< T > & operator= (T value)
 
bool setIfEquals (T testValue, T setValue)
 
swap (T value)
 
operator* () const
 
 BOOST_STATIC_ASSERT_MSG (sizeof(T)==sizeof(int),"qi::Atomic is only supprted for int-like types")
 

Additional Inherited Members

- Public Attributes inherited from qi::AtomicBase< T >
volatile T _value
 

Detailed Description

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

Atomic operations on integers.

* This class permits to do operations on a integer value from multiple threads,
* with the assurance that each operation will not be done from multiple threads
* at the same time.
*
* .. warning::
*     To make sure the code is cross platform, only types
*     which have the same size as ``int`` are supported
* 

Definition at line 88 of file atomic.hpp.

Constructor & Destructor Documentation

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

Default atomic constructor, setting value to 0.

Definition at line 91 of file atomic.hpp.

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

Atomic constructor setting value to its parameter.

Parameters
valueThe default value of the atomic.

Definition at line 96 of file atomic.hpp.


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