48 inline T
set(T value);
60 inline T
add(T value);
66 inline T
sub(T value);
90 #if !AGX_DEBUG_SYNCHRONIZATION_OVERHEAD_TESTING()
91 std::atomic< T > m_value;
109 stream << value.
get();
115 #if !(defined(AGX_APPLE_IOS) || (AGX_DEBUG_SYNCHRONIZATION_OVERHEAD_TESTING()))
125 m_value.store( av.m_value.load() );
131 m_value.store( rhs.m_value.load() );
144 return m_value.exchange( value );
158 return m_value.fetch_add( value );
164 return m_value.fetch_sub( value );
170 return m_value.fetch_add( 1 );
176 return m_value.fetch_sub( 1 );
182 return m_value.compare_exchange_strong( test, newValue );
194 m_value = av.m_value;
200 m_value = rhs.m_value;
255 return this->add(-1);
AtomicValueT template for integral types, all operations are atomic.
T set(T value)
Set the value.
T get() const
Get the current value.
T inc()
Increment the value.
AtomicValueT(const agx::AtomicValueT< T > &av)
AtomicValueT< T > & operator=(const agx::AtomicValueT< T > &rhs)
T compareAndSet(T test, T newValue)
Compares the current value with a test value and if they are equal the value is replaced by a new val...
T dec()
Decrement the value.
AtomicValueT(T initialValue=0)
T add(T value)
Add a value.
T sub(T value)
Subtract a value.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
std::ostream & operator<<(std::ostream &os, const agx::AddedMassInteraction::Matrix6x6 &m)