Honeycomb  0.1
Component-Model Framework
Static Public Member Functions | List of all members
honey::atomic::Op Class Reference

Methods to perform thread-safe atomic read/write operations. More...

#include <Atomic.h>

Inheritance diagram for honey::atomic::Op:
Inheritance graph
[legend]
Collaboration diagram for honey::atomic::Op:
Collaboration graph
[legend]

Static Public Member Functions

template<class T >
static T load (volatile const T &val, Order o=Order::seqCst)
 Returns val. More...
 
template<class T >
static void store (volatile T &dst, T newVal, Order o=Order::seqCst)
 Assigns dst to newVal. More...
 
template<class T >
static bool cas (volatile T &dst, T newVal, T cmp, Order o=Order::seqCst)
 Compare and swap. If dst is equal to comparand cmp then dst is assigned to newVal and true is returned. Returns false otherwise. More...
 
template<class T >
static T swap (volatile T &dst, T newVal, Order o=Order::seqCst)
 Assigns dst to newVal and returns initial value of dst. More...
 
template<class T >
static T inc (volatile T &val, Order o=Order::seqCst)
 Increments val. Returns the initial value. More...
 
template<class T >
static T dec (volatile T &val, Order o=Order::seqCst)
 Decrements val. Returns the initial value. More...
 
template<class T >
static T add (volatile T &val, T rhs, Order o=Order::seqCst)
 val += rhs. Returns the initial value. More...
 
template<class T >
static T and_ (volatile T &val, T rhs, Order o=Order::seqCst)
 val &= rhs. Returns the initial value. More...
 
template<class T >
static T or_ (volatile T &val, T rhs, Order o=Order::seqCst)
 val |= rhs. Returns the initial value. More...
 
template<class T >
static T xor_ (volatile T &val, T rhs, Order o=Order::seqCst)
 val ^= rhs. Returns the initial value. More...
 
static void fence (Order o=Order::seqCst)
 Create a memory barrier that synchronizes operations. More...
 

Detailed Description

Methods to perform thread-safe atomic read/write operations.

Member Function Documentation

template<class T >
static T honey::atomic::Op::add ( volatile T &  val,
rhs,
Order  o = Order::seqCst 
)
inlinestatic

val += rhs. Returns the initial value.

template<class T >
static T honey::atomic::Op::and_ ( volatile T &  val,
rhs,
Order  o = Order::seqCst 
)
inlinestatic

val &= rhs. Returns the initial value.

template<class T >
static bool honey::atomic::Op::cas ( volatile T &  dst,
newVal,
cmp,
Order  o = Order::seqCst 
)
inlinestatic

Compare and swap. If dst is equal to comparand cmp then dst is assigned to newVal and true is returned. Returns false otherwise.

template<class T >
static T honey::atomic::Op::dec ( volatile T &  val,
Order  o = Order::seqCst 
)
inlinestatic

Decrements val. Returns the initial value.

static void honey::atomic::Op::fence ( Order  o = Order::seqCst)
inlinestatic

Create a memory barrier that synchronizes operations.

An acquire fence synchronizes with all releases before it.
A release fence synchronizes with all acquires after it.
A sequential fence is a sequentially consistent acquire and release fence.

See also
std::atomic_thread_fence for details.
template<class T >
static T honey::atomic::Op::inc ( volatile T &  val,
Order  o = Order::seqCst 
)
inlinestatic

Increments val. Returns the initial value.

template<class T >
static T honey::atomic::Op::load ( volatile const T &  val,
Order  o = Order::seqCst 
)
inlinestatic

Returns val.

template<class T >
static T honey::atomic::Op::or_ ( volatile T &  val,
rhs,
Order  o = Order::seqCst 
)
inlinestatic

val |= rhs. Returns the initial value.

template<class T >
static void honey::atomic::Op::store ( volatile T &  dst,
newVal,
Order  o = Order::seqCst 
)
inlinestatic

Assigns dst to newVal.

template<class T >
static T honey::atomic::Op::swap ( volatile T &  dst,
newVal,
Order  o = Order::seqCst 
)
inlinestatic

Assigns dst to newVal and returns initial value of dst.

template<class T >
static T honey::atomic::Op::xor_ ( volatile T &  val,
rhs,
Order  o = Order::seqCst 
)
inlinestatic

val ^= rhs. Returns the initial value.


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