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::value_ptr< T > Class Template Reference

#include <value_ptr.h>

Public Member Functions

 operator bool_type () const
 
Toperator* () const
 
Toperator-> () const
 
value_ptroperator= (value_ptr const &orig)
 
value_ptroperator= (value_ptr &&orig)
 
template<typename U >
value_ptroperator= (value_ptr< U > const &orig)
 
value_ptroperator= (std::auto_ptr< T > 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::auto_ptr< T > 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

TmyP
 

Detailed Description

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

Definition at line 66 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 175 of file value_ptr.h.

Constructor & Destructor Documentation

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

Definition at line 74 of file value_ptr.h.

74 : myP(nullptr) { }
template<typename T>
edm::value_ptr< T >::value_ptr ( T p)
inlineexplicit

Definition at line 75 of file value_ptr.h.

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

Definition at line 76 of file value_ptr.h.

76 { delete myP; }
template<typename T>
edm::value_ptr< T >::value_ptr ( value_ptr< T > const &  orig)
inline

Definition at line 82 of file value_ptr.h.

82  :
83  myP(createFrom(orig.myP)) {
84  }
static T * createFrom(U const *p)
Definition: value_ptr.h:192
template<typename T>
edm::value_ptr< T >::value_ptr ( value_ptr< T > &&  orig)
inline

Definition at line 97 of file value_ptr.h.

97  :
98  myP(orig.myP) { orig.myP=nullptr; }
template<typename T>
template<typename U >
edm::value_ptr< T >::value_ptr ( value_ptr< U > const &  orig)
inline

Definition at line 128 of file value_ptr.h.

128  :
129  myP(createFrom(orig.operator->())) {
130  }
static T * createFrom(U const *p)
Definition: value_ptr.h:192
template<typename T>
edm::value_ptr< T >::value_ptr ( std::auto_ptr< T orig)
inline

Definition at line 143 of file value_ptr.h.

143  :
144  myP(orig.release()) {
145  }
template<typename T>
edm::value_ptr< T >::value_ptr ( std::unique_ptr< T orig)
inline

Definition at line 158 of file value_ptr.h.

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

Member Function Documentation

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

Definition at line 192 of file value_ptr.h.

192  {
193  return p
195  : nullptr;
196  }
static T * clone(T const *p)
Definition: value_ptr.h:55
#define nullptr
template<typename T>
edm::value_ptr< T >::operator bool_type ( ) const
inline

Definition at line 179 of file value_ptr.h.

179  {
180  return myP != nullptr ?
181  &value_ptr<T>::this_type_does_not_support_comparisons : nullptr;
182  }
template<typename T>
T& edm::value_ptr< T >::operator* ( void  ) const
inline

Definition at line 114 of file value_ptr.h.

114 { return *myP; }
template<typename T>
T* edm::value_ptr< T >::operator-> ( ) const
inline

Definition at line 115 of file value_ptr.h.

115 { return myP; }
template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< T > const &  orig)
inline

Definition at line 86 of file value_ptr.h.

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

Definition at line 100 of file value_ptr.h.

100  {
101  if (myP!=orig.myP) {
102  delete myP;
103  myP=orig.myP;
104  orig.myP=nullptr;
105  }
106  return *this;
107  }
template<typename T>
template<typename U >
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< U > const &  orig)
inline

Definition at line 133 of file value_ptr.h.

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

Definition at line 147 of file value_ptr.h.

147  {
148  value_ptr<T> temp(orig);
149  swap(temp);
150  return *this;
151  }
void swap(value_ptr &orig)
Definition: value_ptr.h:121
template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( std::unique_ptr< T orig)
inline

Definition at line 161 of file value_ptr.h.

161  {
162  value_ptr<T> temp(orig);
163  swap(temp);
164  return *this;
165  }
void swap(value_ptr &orig)
Definition: value_ptr.h:121
template<typename T>
void edm::value_ptr< T >::swap ( value_ptr< T > &  orig)
inline

Definition at line 121 of file value_ptr.h.

Referenced by edm::value_ptr< edm::service::MessageLoggerDefaults >::operator=(), and edm::swap().

121 { std::swap(myP, orig.myP); }
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 176 of file value_ptr.h.

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

176 {}

Member Data Documentation

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