CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (T *p)
 
 atomic_value_ptr (atomic_value_ptr const &orig)
 
 atomic_value_ptr (atomic_value_ptr &&orig)
 
template<typename U >
 atomic_value_ptr (atomic_value_ptr< U > const &orig)
 
 atomic_value_ptr (std::auto_ptr< T > orig)
 
 atomic_value_ptr (std::unique_ptr< T > orig)
 
bool compare_exchange_strong (T *&oldValue, T *newValue)
 
Tload () const
 
 operator bool_type () const
 
Toperator* () const
 
Toperator-> () const
 
atomic_value_ptroperator= (atomic_value_ptr const &orig)
 
atomic_value_ptroperator= (atomic_value_ptr &&orig)
 
template<typename U >
atomic_value_ptroperator= (atomic_value_ptr< U > const &orig)
 
atomic_value_ptroperator= (std::auto_ptr< T > 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 47 of file atomic_value_ptr.h.

Member Typedef Documentation

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

Definition at line 149 of file atomic_value_ptr.h.

Constructor & Destructor Documentation

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

Definition at line 55 of file atomic_value_ptr.h.

55 : myP(nullptr) { }
std::atomic< T * > myP
template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( T p)
inlineexplicit

Definition at line 56 of file atomic_value_ptr.h.

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

Definition at line 57 of file atomic_value_ptr.h.

57 { delete myP.load(); }
std::atomic< T * > myP
template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( atomic_value_ptr< T > const &  orig)
inline

Definition at line 63 of file atomic_value_ptr.h.

63  :
64  myP(createFrom(orig.myP.load())) {
65  }
static T * createFrom(U const *p)
std::atomic< T * > myP
template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( atomic_value_ptr< T > &&  orig)
inline

Definition at line 73 of file atomic_value_ptr.h.

73  :
74  myP(orig.myP) { orig.myP.store(nullptr); }
std::atomic< T * > myP
template<typename T>
template<typename U >
edm::atomic_value_ptr< T >::atomic_value_ptr ( atomic_value_ptr< U > const &  orig)
inline

Definition at line 94 of file atomic_value_ptr.h.

94  :
95  myP(createFrom(orig.operator->())) {
96  }
static T * createFrom(U const *p)
std::atomic< T * > myP
template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( std::auto_ptr< T orig)
inline

Definition at line 109 of file atomic_value_ptr.h.

109  :
110  myP(orig.release()) {
111  }
std::atomic< T * > myP
template<typename T>
edm::atomic_value_ptr< T >::atomic_value_ptr ( std::unique_ptr< T orig)
inline

Definition at line 123 of file atomic_value_ptr.h.

123  :
124  myP(orig.release()) {
125  orig = nullptr;
126  }
std::atomic< T * > myP

Member Function Documentation

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

Definition at line 138 of file atomic_value_ptr.h.

138  {
139  return myP.compare_exchange_strong(oldValue, newValue);
140  }
std::atomic< T * > myP
template<typename T>
template<typename U >
static T* edm::atomic_value_ptr< T >::createFrom ( U const *  p)
inlinestaticprivate

Definition at line 177 of file atomic_value_ptr.h.

177  {
178  return p
180  : nullptr;
181  }
#define nullptr
static T * clone(T const *p)
template<typename T>
void edm::atomic_value_ptr< T >::exchangeWithLocal ( atomic_value_ptr< T > &  local)
inlineprivate

Definition at line 166 of file atomic_value_ptr.h.

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

166  {
167  T* old = myP.exchange(local.myP.load());
168  local.myP = old;
169  }
std::atomic< T * > myP
long double T
template<typename T>
T* edm::atomic_value_ptr< T >::load ( ) const
inline

Definition at line 134 of file atomic_value_ptr.h.

134  {
135  return myP.load();
136  }
std::atomic< T * > myP
template<typename T>
edm::atomic_value_ptr< T >::operator bool_type ( ) const
inline

Definition at line 153 of file atomic_value_ptr.h.

153  {
154  return myP != nullptr ?
155  &atomic_value_ptr<T>::this_type_does_not_support_comparisons : nullptr;
156  }
std::atomic< T * > myP
template<typename T>
T& edm::atomic_value_ptr< T >::operator* ( void  ) const
inline

Definition at line 86 of file atomic_value_ptr.h.

86 { return *myP; }
std::atomic< T * > myP
template<typename T>
T* edm::atomic_value_ptr< T >::operator-> ( ) const
inline

Definition at line 87 of file atomic_value_ptr.h.

87 { return myP.load(); }
std::atomic< T * > myP
template<typename T>
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( atomic_value_ptr< T > const &  orig)
inline

Definition at line 67 of file atomic_value_ptr.h.

67  {
68  atomic_value_ptr<T> local(orig);
69  exchangeWithLocal(local);
70  return *this;
71  }
void exchangeWithLocal(atomic_value_ptr &local)
template<typename T>
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( atomic_value_ptr< T > &&  orig)
inline

Definition at line 76 of file atomic_value_ptr.h.

76  {
77  atomic_value_ptr<T> local(orig);
78  exchangeWithLocal(local);
79  return *this;
80  }
void exchangeWithLocal(atomic_value_ptr &local)
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 99 of file atomic_value_ptr.h.

99  {
100  atomic_value_ptr<T> local(orig);
101  exchangeWithLocal(local);
102  return *this;
103  }
void exchangeWithLocal(atomic_value_ptr &local)
template<typename T>
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( std::auto_ptr< T orig)
inline

Definition at line 113 of file atomic_value_ptr.h.

113  {
114  atomic_value_ptr<T> local(orig);
115  exchangeWithLocal(local);
116  return *this;
117  }
void exchangeWithLocal(atomic_value_ptr &local)
template<typename T>
atomic_value_ptr& edm::atomic_value_ptr< T >::operator= ( std::unique_ptr< T orig)
inline

Definition at line 128 of file atomic_value_ptr.h.

128  {
129  atomic_value_ptr<T> local(orig);
130  exchangeWithLocal(local);
131  return *this;
132  }
void exchangeWithLocal(atomic_value_ptr &local)
template<typename T>
void edm::atomic_value_ptr< T >::this_type_does_not_support_comparisons ( ) const
inlineprivate

Definition at line 150 of file atomic_value_ptr.h.

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

150 {}

Member Data Documentation

template<typename T>
std::atomic<T*> edm::atomic_value_ptr< T >::myP
mutableprivate