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 64 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 157 of file value_ptr.h.

Constructor & Destructor Documentation

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

Definition at line 72 of file value_ptr.h.

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

Definition at line 73 of file value_ptr.h.

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

Definition at line 74 of file value_ptr.h.

74 { delete myP.get(); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:184
element_type const * get() const
template<typename T>
edm::value_ptr< T >::value_ptr ( value_ptr< T > const &  orig)
inline

Definition at line 80 of file value_ptr.h.

80  :
81  myP(createFrom(get_underlying_safe(orig.myP))) {
82  }
edm::propagate_const< T * > myP
Definition: value_ptr.h:184
static T * createFrom(U const *p)
Definition: value_ptr.h:174
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 94 of file value_ptr.h.

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

Definition at line 126 of file value_ptr.h.

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

Definition at line 141 of file value_ptr.h.

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

Member Function Documentation

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

Definition at line 174 of file value_ptr.h.

174  {
175  return p
177  : nullptr;
178  }
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 161 of file value_ptr.h.

161  {
162  return myP != nullptr ?
164  }
edm::propagate_const< T * > myP
Definition: value_ptr.h:184
void this_type_does_not_support_comparisons() const
Definition: value_ptr.h:158
template<typename T>
T const& edm::value_ptr< T >::operator* ( void  ) const
inline

Definition at line 110 of file value_ptr.h.

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

Definition at line 111 of file value_ptr.h.

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

Definition at line 112 of file value_ptr.h.

112 { return get_underlying_safe(myP); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:184
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 113 of file value_ptr.h.

113 { return get_underlying_safe(myP); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:184
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 84 of file value_ptr.h.

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

Definition at line 97 of file value_ptr.h.

97  {
98  if (myP!=orig.myP) {
99  delete myP.get();
100  myP=orig.myP;
101  orig.myP=nullptr;
102  }
103  return *this;
104  }
edm::propagate_const< T * > myP
Definition: value_ptr.h:184
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 131 of file value_ptr.h.

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

Definition at line 144 of file value_ptr.h.

144  {
145  value_ptr<T> temp(std::move(orig));
146  swap(temp);
147  return *this;
148  }
void swap(value_ptr &orig)
Definition: value_ptr.h:119
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 119 of file value_ptr.h.

Referenced by edm::swap().

119 { std::swap(myP, orig.myP); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:184
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 158 of file value_ptr.h.

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

158 {}

Member Data Documentation

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