Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::exec::helper::AtomicOptional< T > Class Template Reference

A wrapper around a possible atomic value. More...

#include <atomic_optional.h>

Public Member Functions

constexpr AtomicOptional (T value) noexcept
 Constructor. More...
 
AtomicOptionaloperator= (const AtomicOptional &other)=delete
 
AtomicOptionaloperator= (T value) noexcept
 
void Reset () noexcept
 Reset the instance atomic value.
 
bool HasValue () const noexcept
 Indicate whether the instance has an atomic value or not. More...
 
Value () const
 Get instance possible non-atomic value. More...
 

Detailed Description

template<typename T>
class ara::exec::helper::AtomicOptional< T >

A wrapper around a possible atomic value.

Template Parameters
TPossible non-atomic value type

Constructor & Destructor Documentation

◆ AtomicOptional()

template<typename T >
constexpr ara::exec::helper::AtomicOptional< T >::AtomicOptional ( value)
inlineconstexprnoexcept

Constructor.

Parameters
valueDesired non-atomic value

Member Function Documentation

◆ HasValue()

template<typename T >
bool ara::exec::helper::AtomicOptional< T >::HasValue ( ) const
inlinenoexcept

Indicate whether the instance has an atomic value or not.

Returns
True if has the value, otherwise false

◆ Value()

template<typename T >
T ara::exec::helper::AtomicOptional< T >::Value ( ) const
inline

Get instance possible non-atomic value.

Returns
Copied non-atomic value
Exceptions
std::runtime_errorThrows if there is no value