Botan 3.6.1
Crypto and TLS for C&
Botan::Atomic< typename > Class Template Reference

#include <atomic.h>

Public Member Functions

 Atomic ()=default
 
 Atomic (const Atomic &data)
 
 Atomic (const std::atomic< T > &data)
 
 operator std::atomic< T > & ()
 
 operator T ()
 
Atomicoperator= (const Atomic &other)
 
Atomicoperator= (const std::atomic< T > &a)
 
 ~Atomic ()=default
 

Detailed Description

template<typename>
class Botan::Atomic< typename >

Simple helper class to expand std::atomic with copy constructor and copy assignment operator, i.e. for use as element in a container like std::vector. The construction of instances of this wrapper is NOT atomic and needs to be properly guarded.

Definition at line 131 of file xmss.h.

Constructor & Destructor Documentation

◆ Atomic() [1/3]

template<typename >
Botan::Atomic< typename >::Atomic ( )
default

◆ Atomic() [2/3]

template<typename >
Botan::Atomic< typename >::Atomic ( const Atomic< typename > & data)
inline

Definition at line 28 of file atomic.h.

28: m_data(data.m_data.load()) {}

◆ Atomic() [3/3]

template<typename >
Botan::Atomic< typename >::Atomic ( const std::atomic< T > & data)
inline

Definition at line 30 of file atomic.h.

30: m_data(data.load()) {}

◆ ~Atomic()

template<typename >
Botan::Atomic< typename >::~Atomic ( )
default

Member Function Documentation

◆ operator std::atomic< T > &()

template<typename >
Botan::Atomic< typename >::operator std::atomic< T > & ( )
inline

Definition at line 46 of file atomic.h.

46{ return m_data; }

◆ operator T()

template<typename >
Botan::Atomic< typename >::operator T ( )
inline

Definition at line 48 of file atomic.h.

48{ return m_data.load(); }

◆ operator=() [1/2]

template<typename >
Atomic & Botan::Atomic< typename >::operator= ( const Atomic< typename > & other)
inline

Definition at line 34 of file atomic.h.

34 {
35 if(this != &other) {
36 m_data.store(other.m_data.load());
37 }
38 return *this;
39 }

◆ operator=() [2/2]

template<typename >
Atomic & Botan::Atomic< typename >::operator= ( const std::atomic< T > & a)
inline

Definition at line 41 of file atomic.h.

41 {
42 m_data.store(a.load());
43 return *this;
44 }

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