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

Member Typedef Documentation

◆ bool_type

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

Definition at line 148 of file value_ptr.h.

Constructor & Destructor Documentation

◆ value_ptr() [1/6]

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

Definition at line 69 of file value_ptr.h.

69 : myP(nullptr) {}
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ value_ptr() [2/6]

template<typename T>
edm::value_ptr< T >::value_ptr ( T p)
inlineexplicit

Definition at line 70 of file value_ptr.h.

70 : myP(p) {}
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ ~value_ptr()

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

Definition at line 71 of file value_ptr.h.

constexpr element_type const * get() const
edm::propagate_const< T * > myP
Definition: value_ptr.h:170
static void destroy(T *p)
Definition: value_ptr.h:53

◆ value_ptr() [3/6]

template<typename T>
edm::value_ptr< T >::value_ptr ( value_ptr< T > const &  orig)
inline

Definition at line 77 of file value_ptr.h.

77 : myP(createFrom(get_underlying_safe(orig.myP))) {}
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< T * > myP
Definition: value_ptr.h:170
static T * createFrom(U const *p)
Definition: value_ptr.h:162

◆ value_ptr() [4/6]

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

Definition at line 89 of file value_ptr.h.

89 : myP(orig.myP) { orig.myP = nullptr; }
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ value_ptr() [5/6]

template<typename T>
template<typename U >
edm::value_ptr< T >::value_ptr ( value_ptr< U > const &  orig)
inline

Definition at line 120 of file value_ptr.h.

120 : myP(createFrom(orig.operator->())) {}
edm::propagate_const< T * > myP
Definition: value_ptr.h:170
static T * createFrom(U const *p)
Definition: value_ptr.h:162

◆ value_ptr() [6/6]

template<typename T>
edm::value_ptr< T >::value_ptr ( std::unique_ptr< T orig)
inline

Definition at line 133 of file value_ptr.h.

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

Member Function Documentation

◆ createFrom()

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

Definition at line 162 of file value_ptr.h.

162  {
163  return p ? value_ptr_traits<U>::clone(p) : nullptr;
164  }
static T * clone(T const *p)
Definition: value_ptr.h:52

◆ operator bool_type()

template<typename T>
edm::value_ptr< T >::operator bool_type ( ) const
inline

Definition at line 152 of file value_ptr.h.

152  {
153  return myP != nullptr ? &value_ptr<T>::this_type_does_not_support_comparisons : nullptr;
154  }
void this_type_does_not_support_comparisons() const
Definition: value_ptr.h:149
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ operator*() [1/2]

template<typename T>
T const& edm::value_ptr< T >::operator* ( void  ) const
inline

Definition at line 104 of file value_ptr.h.

104 { return *myP; }
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ operator*() [2/2]

template<typename T>
T& edm::value_ptr< T >::operator* ( void  )
inline

Definition at line 105 of file value_ptr.h.

105 { return *myP; }
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ operator->() [1/2]

template<typename T>
T const* edm::value_ptr< T >::operator-> ( ) const
inline

Definition at line 106 of file value_ptr.h.

106 { return get_underlying_safe(myP); }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ operator->() [2/2]

template<typename T>
T* edm::value_ptr< T >::operator-> ( )
inline

Definition at line 107 of file value_ptr.h.

107 { return get_underlying_safe(myP); }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ operator=() [1/4]

template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< T > const &  orig)
inline

Definition at line 79 of file value_ptr.h.

79  {
80  value_ptr<T> temp(orig);
81  swap(temp);
82  return *this;
83  }
void swap(value_ptr &orig)
Definition: value_ptr.h:113

◆ operator=() [2/4]

template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< T > &&  orig)
inline

Definition at line 91 of file value_ptr.h.

91  {
92  if (myP != orig.myP) {
93  delete myP.get();
94  myP = orig.myP;
95  orig.myP = nullptr;
96  }
97  return *this;
98  }
constexpr element_type const * get() const
edm::propagate_const< T * > myP
Definition: value_ptr.h:170

◆ operator=() [3/4]

template<typename T>
template<typename U >
value_ptr& edm::value_ptr< T >::operator= ( value_ptr< U > const &  orig)
inline

Definition at line 123 of file value_ptr.h.

123  {
124  value_ptr<T> temp(orig);
125  swap(temp);
126  return *this;
127  }
void swap(value_ptr &orig)
Definition: value_ptr.h:113

◆ operator=() [4/4]

template<typename T>
value_ptr& edm::value_ptr< T >::operator= ( std::unique_ptr< T orig)
inline

Definition at line 135 of file value_ptr.h.

135  {
136  value_ptr<T> temp(std::move(orig));
137  swap(temp);
138  return *this;
139  }
void swap(value_ptr &orig)
Definition: value_ptr.h:113
def move(src, dest)
Definition: eostools.py:511

◆ swap()

template<typename T>
void edm::value_ptr< T >::swap ( value_ptr< T > &  orig)
inline

Definition at line 113 of file value_ptr.h.

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

113 { std::swap(myP, orig.myP); }
edm::propagate_const< T * > myP
Definition: value_ptr.h:170
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

◆ this_type_does_not_support_comparisons()

template<typename T>
void edm::value_ptr< T >::this_type_does_not_support_comparisons ( ) const
inlineprivate

Definition at line 149 of file value_ptr.h.

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

149 {}

Member Data Documentation

◆ myP

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