CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
edm::atomic_value_ptr< T > Class Template Reference

#include <atomic_value_ptr.h>

Public Member Functions

 atomic_value_ptr ()
 
 atomic_value_ptr (atomic_value_ptr &&orig)
 
 atomic_value_ptr (atomic_value_ptr const &orig)
 
template<typename U >
 atomic_value_ptr (atomic_value_ptr< U > const &orig)
 
 atomic_value_ptr (std::unique_ptr< T > orig)
 
 atomic_value_ptr (T *p)
 
bool compare_exchange_strong (T *&oldValue, T *newValue)
 
Tload () const
 
 operator bool_type () const
 
Toperator* () const
 
Toperator-> () const
 
atomic_value_ptroperator= (atomic_value_ptr &&orig)
 
atomic_value_ptroperator= (atomic_value_ptr const &orig)
 
template<typename U >
atomic_value_ptroperator= (atomic_value_ptr< U > const &orig)
 
atomic_value_ptroperator= (std::unique_ptr< T > orig)
 
 ~atomic_value_ptr ()
 

Private Types

typedef void(atomic_value_ptr::* bool_type) () const
 

Private Member Functions

void exchangeWithLocal (atomic_value_ptr &local)
 
void this_type_does_not_support_comparisons () const
 

Static Private Member Functions

template<typename U >
static TcreateFrom (U const *p)
 

Private Attributes

std::atomic< T * > myP
 

Detailed Description

template<typename T>
class edm::atomic_value_ptr< T >

Definition at line 45 of file atomic_value_ptr.h.

Member Typedef Documentation

◆ bool_type

template<typename T>
typedef void(atomic_value_ptr::* edm::atomic_value_ptr< T >::bool_type) () const
private

Definition at line 119 of file atomic_value_ptr.h.

Constructor & Destructor Documentation

◆ atomic_value_ptr() [1/6]

template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( )
inline

Definition at line 51 of file atomic_value_ptr.h.

51 : myP(nullptr) {}

◆ atomic_value_ptr() [2/6]

template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( T p)
inlineexplicit

Definition at line 52 of file atomic_value_ptr.h.

52 : myP(p) {}

◆ ~atomic_value_ptr()

template<typename T>
edm::atomic_value_ptr< T >::~atomic_value_ptr ( )
inline

Definition at line 53 of file atomic_value_ptr.h.

53 { delete myP.load(); }

◆ atomic_value_ptr() [3/6]

template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( atomic_value_ptr< T > const &  orig)
inline

Definition at line 59 of file atomic_value_ptr.h.

59 : myP(createFrom(orig.myP.load())) {}

◆ atomic_value_ptr() [4/6]

template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( atomic_value_ptr< T > &&  orig)
inline

Definition at line 67 of file atomic_value_ptr.h.

67 : myP(orig.myP.load()) { orig.myP.store(nullptr); }

◆ atomic_value_ptr() [5/6]

template<typename T>
template<typename U >
edm::atomic_value_ptr< T >::atomic_value_ptr ( atomic_value_ptr< U > const &  orig)
inline

Definition at line 87 of file atomic_value_ptr.h.

87 : myP(createFrom(orig.operator->())) {}

◆ atomic_value_ptr() [6/6]

template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( std::unique_ptr< T orig)
inline

Definition at line 100 of file atomic_value_ptr.h.

100 : myP(orig.release()) { orig = nullptr; }

Member Function Documentation

◆ compare_exchange_strong()

template<typename T>
bool edm::atomic_value_ptr< T >::compare_exchange_strong ( T *&  oldValue,
T newValue 
)
inline

Definition at line 110 of file atomic_value_ptr.h.

110 { return myP.compare_exchange_strong(oldValue, newValue); }

◆ createFrom()

template<typename T>
template<typename U >
static T* edm::atomic_value_ptr< T >::createFrom ( U const *  p)
inlinestaticprivate

Definition at line 144 of file atomic_value_ptr.h.

144  {
145  return p ? atomic_value_ptr_traits<U>::clone(p) : nullptr;
146  }

◆ exchangeWithLocal()

template<typename T>
void edm::atomic_value_ptr< T >::exchangeWithLocal ( atomic_value_ptr< T > &  local)
inlineprivate

Definition at line 134 of file atomic_value_ptr.h.

134  {
135  T* old = myP.exchange(local.myP.load());
136  local.myP = old;
137  }

Referenced by edm::atomic_value_ptr< edm::ParameterSet >::operator=().

◆ load()

template<typename T>
T* edm::atomic_value_ptr< T >::load ( ) const
inline

Definition at line 108 of file atomic_value_ptr.h.

108 { return myP.load(); }

◆ operator bool_type()

template<typename T>
edm::atomic_value_ptr< T >::operator bool_type ( ) const
inline

Definition at line 123 of file atomic_value_ptr.h.

123  {
125  }

◆ operator*()

template<typename T>
T& edm::atomic_value_ptr< T >::operator* ( void  ) const
inline

Definition at line 79 of file atomic_value_ptr.h.

79 { return *myP; }

◆ operator->()

template<typename T>
T* edm::atomic_value_ptr< T >::operator-> ( ) const
inline

Definition at line 80 of file atomic_value_ptr.h.

80 { return myP.load(); }

◆ operator=() [1/4]

template<typename T>
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( atomic_value_ptr< T > &&  orig)
inline

Definition at line 69 of file atomic_value_ptr.h.

69  {
70  atomic_value_ptr<T> local(orig);
72  return *this;
73  }

◆ operator=() [2/4]

template<typename T>
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( atomic_value_ptr< T > const &  orig)
inline

Definition at line 61 of file atomic_value_ptr.h.

61  {
62  atomic_value_ptr<T> local(orig);
64  return *this;
65  }

◆ operator=() [3/4]

template<typename T>
template<typename U >
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( atomic_value_ptr< U > const &  orig)
inline

Definition at line 90 of file atomic_value_ptr.h.

90  {
91  atomic_value_ptr<T> local(orig);
93  return *this;
94  }

◆ operator=() [4/4]

template<typename T>
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( std::unique_ptr< T orig)
inline

Definition at line 102 of file atomic_value_ptr.h.

102  {
103  atomic_value_ptr<T> local(std::move(orig));
105  return *this;
106  }

◆ this_type_does_not_support_comparisons()

template<typename T>
void edm::atomic_value_ptr< T >::this_type_does_not_support_comparisons ( ) const
inlineprivate

Definition at line 120 of file atomic_value_ptr.h.

120 {}

Referenced by edm::operator!=(), and edm::operator==().

Member Data Documentation

◆ myP

template<typename T>
std::atomic<T*> edm::atomic_value_ptr< T >::myP
mutableprivate
edm::atomic_value_ptr_traits::clone
static T * clone(T const *p)
Definition: atomic_value_ptr.h:35
edm::atomic_value_ptr::myP
std::atomic< T * > myP
Definition: atomic_value_ptr.h:152
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::atomic_value_ptr::this_type_does_not_support_comparisons
void this_type_does_not_support_comparisons() const
Definition: atomic_value_ptr.h:120
T
long double T
Definition: Basic3DVectorLD.h:48
edm::atomic_value_ptr::createFrom
static T * createFrom(U const *p)
Definition: atomic_value_ptr.h:144
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
edm::atomic_value_ptr::exchangeWithLocal
void exchangeWithLocal(atomic_value_ptr &local)
Definition: atomic_value_ptr.h:134