TracktionEngine
Public Member Functions | List of all members
tracktion::engine::AtomicWrapper< Type, Constrainer > Struct Template Reference

Wraps an atomic with an interface compatible with var so it can be used within CachedValues in a thread safe way. More...

Public Member Functions

 AtomicWrapper ()=default
 Constructor. More...
 
template<typename OtherType >
 AtomicWrapper (const OtherType &other)
 Constructs a copy of another wrapper type. More...
 
 AtomicWrapper (const AtomicWrapper &other)
 Constructs a copy of another AtomicWrapper. More...
 
AtomicWrapperoperator= (const AtomicWrapper &other) noexcept
 Assigns another AtomicWrapper's underlying value to this one atomically. More...
 
bool operator== (const AtomicWrapper &other) const noexcept
 Compares the unerlaying value of another wrapper with this one. More...
 
bool operator!= (const AtomicWrapper &other) const noexcept
 Compares the unerlaying value of another wrapper with this one. More...
 
 operator juce::var () const noexcept
 Returns the underlying value as a var. More...
 
 operator Type () const noexcept
 Returns the underlying value. More...
 

Detailed Description

template<typename Type, typename Constrainer = DummyConstrainer<Type>>
struct tracktion::engine::AtomicWrapper< Type, Constrainer >

Wraps an atomic with an interface compatible with var so it can be used within CachedValues in a thread safe way.

Optionally supply a Constrainer to limit the value in some way.

Constructor & Destructor Documentation

◆ AtomicWrapper() [1/3]

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
tracktion::engine::AtomicWrapper< Type, Constrainer >::AtomicWrapper ( )
default

Constructor.

◆ AtomicWrapper() [2/3]

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
template<typename OtherType >
tracktion::engine::AtomicWrapper< Type, Constrainer >::AtomicWrapper ( const OtherType &  other)

Constructs a copy of another wrapper type.

◆ AtomicWrapper() [3/3]

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
tracktion::engine::AtomicWrapper< Type, Constrainer >::AtomicWrapper ( const AtomicWrapper< Type, Constrainer > &  other)

Constructs a copy of another AtomicWrapper.

Member Function Documentation

◆ operator=()

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
AtomicWrapper& tracktion::engine::AtomicWrapper< Type, Constrainer >::operator= ( const AtomicWrapper< Type, Constrainer > &  other)
noexcept

Assigns another AtomicWrapper's underlying value to this one atomically.

◆ operator==()

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
bool tracktion::engine::AtomicWrapper< Type, Constrainer >::operator== ( const AtomicWrapper< Type, Constrainer > &  other) const
noexcept

Compares the unerlaying value of another wrapper with this one.

◆ operator!=()

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
bool tracktion::engine::AtomicWrapper< Type, Constrainer >::operator!= ( const AtomicWrapper< Type, Constrainer > &  other) const
noexcept

Compares the unerlaying value of another wrapper with this one.

◆ operator juce::var()

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
tracktion::engine::AtomicWrapper< Type, Constrainer >::operator juce::var ( ) const
noexcept

Returns the underlying value as a var.

◆ operator Type()

template<typename Type , typename Constrainer = DummyConstrainer<Type>>
tracktion::engine::AtomicWrapper< Type, Constrainer >::operator Type ( ) const
noexcept

Returns the underlying value.


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