CMS 3D CMS Logo

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

#include <value_ptr.h>

Public Member Functions

 operator bool_type () const
 
T const & operator* () const
 
Toperator* ()
 
T const * operator-> () const
 
Toperator-> ()
 
value_ptroperator= (value_ptr const &orig)
 
value_ptroperator= (value_ptr &&orig)
 
template<typename U >
value_ptroperator= (value_ptr< U > const &orig)
 
value_ptroperator= (std::unique_ptr< T > orig)
 
void swap (value_ptr &orig)
 
 value_ptr ()
 
 value_ptr (T *p)
 
 value_ptr (value_ptr const &orig)
 
 value_ptr (value_ptr &&orig)
 
template<typename U >
 value_ptr (value_ptr< U > const &orig)
 
 value_ptr (std::unique_ptr< T > orig)
 
 ~value_ptr ()
 

Private Types

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

Private Member Functions

void this_type_does_not_support_comparisons () const
 

Static Private Member Functions

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

Private Attributes

edm::propagate_const< T * > myP
 

Detailed Description

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

Definition at line 65 of file value_ptr.h.

Member Typedef Documentation

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

Definition at line 158 of file value_ptr.h.

Constructor & Destructor Documentation

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

Definition at line 73 of file value_ptr.h.

73 : myP(nullptr) { }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
template<typename T>
edm::value_ptr< T >::value_ptr ( T p)
inlineexplicit

Definition at line 74 of file value_ptr.h.

74 : myP(p) { }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
template<typename T>
edm::value_ptr< T >::~value_ptr ( )
inline

Definition at line 75 of file value_ptr.h.

edm::propagate_const< T * > myP
Definition: value_ptr.h:185
static void destroy(T *p)
Definition: value_ptr.h:54
element_type const * get() const
template<typename T>
edm::value_ptr< T >::value_ptr ( value_ptr< T > const &  orig)
inline

Definition at line 81 of file value_ptr.h.

81  :
82  myP(createFrom(get_underlying_safe(orig.myP))) {
83  }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
static T * createFrom(U const *p)
Definition: value_ptr.h:175
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
template<typename T>
edm::value_ptr< T >::value_ptr ( value_ptr< T > &&  orig)
inline

Definition at line 95 of file value_ptr.h.

95  :
96  myP(orig.myP) { orig.myP=nullptr; }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
template<typename T>
template<typename U >
edm::value_ptr< T >::value_ptr ( value_ptr< U > const &  orig)
inline

Definition at line 127 of file value_ptr.h.

127  :
128  myP(createFrom(orig.operator->())) {
129  }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
static T * createFrom(U const *p)
Definition: value_ptr.h:175
template<typename T>
edm::value_ptr< T >::value_ptr ( std::unique_ptr< T orig)
inline

Definition at line 142 of file value_ptr.h.

142  :
143  myP(orig.release()) { orig=nullptr; }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185

Member Function Documentation

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

Definition at line 175 of file value_ptr.h.

175  {
176  return p
178  : nullptr;
179  }
static T * clone(T const *p)
Definition: value_ptr.h:53
#define nullptr
template<typename T>
edm::value_ptr< T >::operator bool_type ( ) const
inline

Definition at line 162 of file value_ptr.h.

162  {
163  return myP != nullptr ?
165  }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
void this_type_does_not_support_comparisons() const
Definition: value_ptr.h:159
template<typename T>
T const& edm::value_ptr< T >::operator* ( void  ) const
inline

Definition at line 111 of file value_ptr.h.

111 { return *myP; }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
template<typename T>
T& edm::value_ptr< T >::operator* ( void  )
inline

Definition at line 112 of file value_ptr.h.

112 { return *myP; }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
template<typename T>
T const* edm::value_ptr< T >::operator-> ( ) const
inline

Definition at line 113 of file value_ptr.h.

113 { return get_underlying_safe(myP); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
template<typename T>
T* edm::value_ptr< T >::operator-> ( )
inline

Definition at line 114 of file value_ptr.h.

114 { return get_underlying_safe(myP); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< T > const &  orig)
inline

Definition at line 85 of file value_ptr.h.

85  {
86  value_ptr<T> temp(orig);
87  swap(temp);
88  return *this;
89  }
void swap(value_ptr &orig)
Definition: value_ptr.h:120
template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< T > &&  orig)
inline

Definition at line 98 of file value_ptr.h.

98  {
99  if (myP!=orig.myP) {
100  delete myP.get();
101  myP=orig.myP;
102  orig.myP=nullptr;
103  }
104  return *this;
105  }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
element_type const * get() const
template<typename T>
template<typename U >
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< U > const &  orig)
inline

Definition at line 132 of file value_ptr.h.

132  {
133  value_ptr<T> temp(orig);
134  swap(temp);
135  return *this;
136  }
void swap(value_ptr &orig)
Definition: value_ptr.h:120
template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( std::unique_ptr< T orig)
inline

Definition at line 145 of file value_ptr.h.

145  {
146  value_ptr<T> temp(std::move(orig));
147  swap(temp);
148  return *this;
149  }
void swap(value_ptr &orig)
Definition: value_ptr.h:120
def move(src, dest)
Definition: eostools.py:510
template<typename T>
void edm::value_ptr< T >::swap ( value_ptr< T > &  orig)
inline

Definition at line 120 of file value_ptr.h.

Referenced by edm::swap().

120 { std::swap(myP, orig.myP); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:185
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
template<typename T>
void edm::value_ptr< T >::this_type_does_not_support_comparisons ( ) const
inlineprivate

Definition at line 159 of file value_ptr.h.

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

159 {}

Member Data Documentation

template<typename T>
edm::propagate_const<T*> edm::value_ptr< T >::myP
private