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
 
Toperator* ()
 
T const & operator* () const
 
Toperator-> ()
 
T const * operator-> () const
 
value_ptroperator= (std::unique_ptr< T > orig)
 
value_ptroperator= (value_ptr &&orig)
 
value_ptroperator= (value_ptr const &orig)
 
template<typename U >
value_ptroperator= (value_ptr< U > const &orig)
 
void swap (value_ptr &orig)
 
 value_ptr ()
 
 value_ptr (std::unique_ptr< T > orig)
 
 value_ptr (T *p)
 
 value_ptr (value_ptr &&orig)
 
 value_ptr (value_ptr const &orig)
 
template<typename U >
 value_ptr (value_ptr< U > const &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) {}

◆ 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) {}

◆ ~value_ptr()

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

Definition at line 71 of file value_ptr.h.

◆ 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))) {}

◆ 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; }

◆ 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->())) {}

◆ 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; }

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  }

◆ 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  }

◆ operator*() [1/2]

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

Definition at line 105 of file value_ptr.h.

105 { return *myP; }

◆ operator*() [2/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; }

◆ operator->() [1/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); }

◆ operator->() [2/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); }

◆ operator=() [1/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  }

◆ 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  }

◆ operator=() [3/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  }

◆ operator=() [4/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  }

◆ swap()

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

Definition at line 113 of file value_ptr.h.

113 { std::swap(myP, orig.myP); }

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

◆ 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.

149 {}

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

Member Data Documentation

◆ myP

template<typename T>
edm::propagate_const<T*> edm::value_ptr< T >::myP
private
edm::propagate_const::get
constexpr element_type const * get() const
Definition: propagate_const.h:64
edm::value_ptr::myP
edm::propagate_const< T * > myP
Definition: value_ptr.h:170
edm::get_underlying_safe
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Definition: get_underlying_safe.h:41
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::value_ptr_traits::destroy
static void destroy(T *p)
Definition: value_ptr.h:53
edm::value_ptr::swap
void swap(value_ptr &orig)
Definition: value_ptr.h:113
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::value_ptr::this_type_does_not_support_comparisons
void this_type_does_not_support_comparisons() const
Definition: value_ptr.h:149
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::value_ptr::createFrom
static T * createFrom(U const *p)
Definition: value_ptr.h:162
edm::value_ptr_traits::clone
static T * clone(T const *p)
Definition: value_ptr.h:52
eostools.move
def move(src, dest)
Definition: eostools.py:511