Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::Atomic< T > 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 ()
Atomic & | operator= (const Atomic &a)
Atomic & | operator= (const std::atomic< T > &a)
| ~Atomic ()=default

## Detailed Description

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

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 23 of file atomic.h.

## Constructor & Destructor Documentation

template<typename T >

Botan::Atomic< T >::Atomic | ( |  | ) |
| default

template<typename T >

Botan::Atomic< T >::Atomic | ( | const Atomic< T > & | data | ) |
| inline

Definition at line 27 of file atomic.h.

27 : m_data(data.m_data.load()) {}
template<typename T >

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

Definition at line 28 of file atomic.h.

28 : m_data(data.load()) {}
template<typename T >

Botan::Atomic< T >::~Atomic | ( |  | ) |
| default

## Member Function Documentation

template<typename T >

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

Definition at line 43 of file atomic.h.

43 { return m_data; }
template<typename T >

Botan::Atomic< T >::operator T | ( |  | ) |
| inline

Definition at line 44 of file atomic.h.

44 { return m_data.load(); }
template<typename T >

Atomic& Botan::Atomic< T >::operator= | ( | const Atomic< T > & | a | ) |
| inline

Definition at line 31 of file atomic.h.

32 {
33 m_data.store(a.m_data.load());
34 return *this;
35 }
template<typename T >

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

Definition at line 37 of file atomic.h.

38 {
39 m_data.store(a.load());
40 return *this;
41 }

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

- src/lib/pubkey/xmss/atomic.h