TracktionEngine
Loading...
Searching...
No Matches
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...

#include <tracktion_AtomicWrapper.h>

Public Member Functions

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

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=() [1/2]

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=() [2/2]

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

Assigns a value to this one atomically.

◆ operator==() [1/2]

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

Compares the underlaying value of another wrapper with this one.

◆ operator!=() [1/2]

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

Compares the underlaying value of another wrapper with this one.

◆ operator==() [2/2]

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

Compares another value with this one.

◆ operator!=() [2/2]

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

Compares another value 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: