test
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 62 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 167 of file value_ptr.h.

Constructor & Destructor Documentation

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

Definition at line 70 of file value_ptr.h.

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

Definition at line 71 of file value_ptr.h.

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

Definition at line 72 of file value_ptr.h.

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

Definition at line 78 of file value_ptr.h.

78  :
79  myP(createFrom(orig.myP)) {
80  }
static T * createFrom(U const *p)
Definition: value_ptr.h:184
template<typename T>
edm::value_ptr< T >::value_ptr ( value_ptr< T > &&  orig)
inline

Definition at line 92 of file value_ptr.h.

92  :
93  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 122 of file value_ptr.h.

122  :
123  myP(createFrom(orig.operator->())) {
124  }
static T * createFrom(U const *p)
Definition: value_ptr.h:184
template<typename T>
edm::value_ptr< T >::value_ptr ( std::auto_ptr< T orig)
inline

Definition at line 137 of file value_ptr.h.

137  :
138  myP(orig.release()) {
139  }
template<typename T>
edm::value_ptr< T >::value_ptr ( std::unique_ptr< T orig)
inline

Definition at line 151 of file value_ptr.h.

151  :
152  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 184 of file value_ptr.h.

184  {
185  return p
187  : nullptr;
188  }
static T * clone(T const *p)
Definition: value_ptr.h:51
#define nullptr
template<typename T>
edm::value_ptr< T >::operator bool_type ( ) const
inline

Definition at line 171 of file value_ptr.h.

171  {
172  return myP != nullptr ?
173  &value_ptr<T>::this_type_does_not_support_comparisons : nullptr;
174  }
template<typename T>
T& edm::value_ptr< T >::operator* ( void  ) const
inline

Definition at line 108 of file value_ptr.h.

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

Definition at line 109 of file value_ptr.h.

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

Definition at line 82 of file value_ptr.h.

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

Definition at line 95 of file value_ptr.h.

95  {
96  if (myP!=orig.myP) {
97  delete myP;
98  myP=orig.myP;
99  orig.myP=nullptr;
100  }
101  return *this;
102  }
template<typename T>
template<typename U >
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< U > const &  orig)
inline

Definition at line 127 of file value_ptr.h.

127  {
128  value_ptr<T> temp(orig);
129  swap(temp);
130  return *this;
131  }
void swap(value_ptr &orig)
Definition: value_ptr.h:115
template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( std::auto_ptr< T orig)
inline

Definition at line 141 of file value_ptr.h.

141  {
142  value_ptr<T> temp(orig);
143  swap(temp);
144  return *this;
145  }
void swap(value_ptr &orig)
Definition: value_ptr.h:115
template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( std::unique_ptr< T orig)
inline

Definition at line 154 of file value_ptr.h.

154  {
155  value_ptr<T> temp(orig);
156  swap(temp);
157  return *this;
158  }
void swap(value_ptr &orig)
Definition: value_ptr.h:115
template<typename T>
void edm::value_ptr< T >::swap ( value_ptr< T > &  orig)
inline

Definition at line 115 of file value_ptr.h.

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

115 { 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 168 of file value_ptr.h.

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

168 {}

Member Data Documentation

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