Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cet::value_ptr< Element, Cloner, Deleter > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cetlib/v3_06_01/source/cetlib/value_ptr.h"

Classes

struct  is_compatible
 

Public Types

using element_type = Element
 
using cloner_type = Cloner
 
using deleter_type = Deleter
 
using pointer = typename std::add_pointer< Element >::type
 
using reference = typename std::add_lvalue_reference< Element >::type
 

Public Member Functions

constexpr value_ptr () noexcept
 
constexpr value_ptr (std::nullptr_t) noexcept
 
template<class E2 >
 value_ptr (E2 *other) noexcept
 
 value_ptr (value_ptr const &other)
 
template<class E2 >
 value_ptr (value_ptr< E2, Cloner, Deleter > const &other, std::enable_if_t< is_compatible< E2 >::value > *=nullptr)
 
 value_ptr (value_ptr &&other) noexcept
 
template<class E2 >
 value_ptr (value_ptr< E2, Cloner, Deleter > &&other, std::enable_if_t< is_compatible< E2 >::value > *=nullptr) noexcept
 
 ~value_ptr () noexcept
 
value_ptroperator= (std::nullptr_t) noexcept
 
value_ptroperator= (value_ptr const &other)
 
template<class E2 >
std::enable_if_t< is_compatible< E2 >::value, value_ptr & > operator= (value_ptr< E2, Cloner, Deleter > const &other)
 
value_ptroperator= (value_ptr &&other) noexcept
 
template<class E2 >
std::enable_if_t< is_compatible< E2 >::value, value_ptr & > operator= (value_ptr< E2, Cloner, Deleter > &&other) noexcept
 
reference operator* () const
 
pointer operator-> () const noexcept
 
pointer get () const noexcept
 
 operator bool () const noexcept
 
pointer release () noexcept
 
void reset (pointer t=pointer()) noexcept
 
void swap (value_ptr &other) noexcept
 

Private Member Functions

template<class P >
pointer clone_from (P const p) const
 

Private Attributes

pointer p
 

Detailed Description

template<class Element, class Cloner, class Deleter>
class cet::value_ptr< Element, Cloner, Deleter >

Definition at line 89 of file value_ptr.h.

Member Typedef Documentation

template<class Element, class Cloner, class Deleter>
using cet::value_ptr< Element, Cloner, Deleter >::cloner_type = Cloner

Definition at line 190 of file value_ptr.h.

template<class Element, class Cloner, class Deleter>
using cet::value_ptr< Element, Cloner, Deleter >::deleter_type = Deleter

Definition at line 191 of file value_ptr.h.

template<class Element, class Cloner, class Deleter>
using cet::value_ptr< Element, Cloner, Deleter >::element_type = Element

Definition at line 189 of file value_ptr.h.

template<class Element, class Cloner, class Deleter>
using cet::value_ptr< Element, Cloner, Deleter >::pointer = typename std::add_pointer<Element>::type

Definition at line 192 of file value_ptr.h.

template<class Element, class Cloner, class Deleter>
using cet::value_ptr< Element, Cloner, Deleter >::reference = typename std::add_lvalue_reference<Element>::type

Definition at line 194 of file value_ptr.h.

Constructor & Destructor Documentation

template<class Element, class Cloner, class Deleter>
constexpr cet::value_ptr< Element, Cloner, Deleter >::value_ptr ( )
inlinenoexcept

Definition at line 204 of file value_ptr.h.

204 : p{nullptr} {}
const char * p
Definition: xmltok.h:285
template<class Element, class Cloner, class Deleter>
constexpr cet::value_ptr< Element, Cloner, Deleter >::value_ptr ( std::nullptr_t  )
inlinenoexcept

Definition at line 207 of file value_ptr.h.

207 : p{nullptr} {}
const char * p
Definition: xmltok.h:285
template<class Element, class Cloner, class Deleter>
template<class E2 >
cet::value_ptr< Element, Cloner, Deleter >::value_ptr ( E2 *  other)
inlineexplicitnoexcept

Definition at line 210 of file value_ptr.h.

210  : p{other}
211  {
212  static_assert(is_compatible<E2>::value,
213  "value_ptr<>'s pointee type is incompatible!");
214  static_assert(
216  !(std::is_same<Cloner, _::default_action<Element, false>>::value),
217  "value_ptr<>'s pointee type would slice when copying!");
218  }
const char * p
Definition: xmltok.h:285
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<class Element, class Cloner, class Deleter>
cet::value_ptr< Element, Cloner, Deleter >::value_ptr ( value_ptr< Element, Cloner, Deleter > const &  other)
inline

Definition at line 221 of file value_ptr.h.

221 : p{clone_from(other.p)} {}
const char * p
Definition: xmltok.h:285
pointer clone_from(P const p) const
Definition: value_ptr.h:319
template<class Element, class Cloner, class Deleter>
template<class E2 >
cet::value_ptr< Element, Cloner, Deleter >::value_ptr ( value_ptr< E2, Cloner, Deleter > const &  other,
std::enable_if_t< is_compatible< E2 >::value > *  = nullptr 
)
inline

Definition at line 224 of file value_ptr.h.

226  : p{clone_from(other.p)}
227  {}
const char * p
Definition: xmltok.h:285
pointer clone_from(P const p) const
Definition: value_ptr.h:319
template<class Element, class Cloner, class Deleter>
cet::value_ptr< Element, Cloner, Deleter >::value_ptr ( value_ptr< Element, Cloner, Deleter > &&  other)
inlinenoexcept

Definition at line 230 of file value_ptr.h.

230 : p{other.release()} {}
const char * p
Definition: xmltok.h:285
template<class Element, class Cloner, class Deleter>
template<class E2 >
cet::value_ptr< Element, Cloner, Deleter >::value_ptr ( value_ptr< E2, Cloner, Deleter > &&  other,
std::enable_if_t< is_compatible< E2 >::value > *  = nullptr 
)
inlinenoexcept

Definition at line 233 of file value_ptr.h.

235  : p(other.release())
236  {}
template<class Element, class Cloner, class Deleter>
cet::value_ptr< Element, Cloner, Deleter >::~value_ptr ( )
inlinenoexcept

Definition at line 239 of file value_ptr.h.

239 { reset(); }
void reset(pointer t=pointer()) noexcept
Definition: value_ptr.h:303

Member Function Documentation

template<class Element, class Cloner, class Deleter>
template<class P >
pointer cet::value_ptr< Element, Cloner, Deleter >::clone_from ( P const  p) const
inlineprivate

Definition at line 319 of file value_ptr.h.

320  {
321  return p ? Cloner()(p) : nullptr;
322  }
const char * p
Definition: xmltok.h:285
template<class Element, class Cloner, class Deleter>
pointer cet::value_ptr< Element, Cloner, Deleter >::get ( ) const
inlinenoexcept

Definition at line 287 of file value_ptr.h.

Referenced by cet::operator==().

288  {
289  return p;
290  }
template<class Element, class Cloner, class Deleter>
cet::value_ptr< Element, Cloner, Deleter >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 292 of file value_ptr.h.

292 { return get(); }
template<class Element, class Cloner, class Deleter>
reference cet::value_ptr< Element, Cloner, Deleter >::operator* ( ) const
inline

Definition at line 284 of file value_ptr.h.

284 { return *get(); }
template<class Element, class Cloner, class Deleter>
pointer cet::value_ptr< Element, Cloner, Deleter >::operator-> ( ) const
inlinenoexcept

Definition at line 285 of file value_ptr.h.

285 { return get(); }
template<class Element, class Cloner, class Deleter>
value_ptr& cet::value_ptr< Element, Cloner, Deleter >::operator= ( std::nullptr_t  )
inlinenoexcept

Definition at line 242 of file value_ptr.h.

243  {
244  reset(nullptr);
245  return *this;
246  }
void reset(pointer t=pointer()) noexcept
Definition: value_ptr.h:303
template<class Element, class Cloner, class Deleter>
value_ptr& cet::value_ptr< Element, Cloner, Deleter >::operator= ( value_ptr< Element, Cloner, Deleter > const &  other)
inline

Definition at line 249 of file value_ptr.h.

250  {
252  swap(tmp);
253  return *this;
254  }
void swap(value_ptr &other) noexcept
Definition: value_ptr.h:309
Float_t tmp
Definition: plot.C:36
constexpr value_ptr() noexcept
Definition: value_ptr.h:204
template<class Element, class Cloner, class Deleter>
template<class E2 >
std::enable_if_t<is_compatible<E2>::value, value_ptr&> cet::value_ptr< Element, Cloner, Deleter >::operator= ( value_ptr< E2, Cloner, Deleter > const &  other)
inline

Definition at line 258 of file value_ptr.h.

259  {
261  swap(tmp);
262  return *this;
263  }
void swap(value_ptr &other) noexcept
Definition: value_ptr.h:309
Float_t tmp
Definition: plot.C:36
constexpr value_ptr() noexcept
Definition: value_ptr.h:204
template<class Element, class Cloner, class Deleter>
value_ptr& cet::value_ptr< Element, Cloner, Deleter >::operator= ( value_ptr< Element, Cloner, Deleter > &&  other)
inlinenoexcept

Definition at line 267 of file value_ptr.h.

268  {
269  value_ptr tmp{std::move(other)};
270  swap(tmp);
271  return *this;
272  }
void swap(value_ptr &other) noexcept
Definition: value_ptr.h:309
Float_t tmp
Definition: plot.C:36
constexpr value_ptr() noexcept
Definition: value_ptr.h:204
template<class Element, class Cloner, class Deleter>
template<class E2 >
std::enable_if_t<is_compatible<E2>::value, value_ptr&> cet::value_ptr< Element, Cloner, Deleter >::operator= ( value_ptr< E2, Cloner, Deleter > &&  other)
inlinenoexcept

Definition at line 276 of file value_ptr.h.

277  {
278  value_ptr tmp{std::move(other)};
279  swap(tmp);
280  return *this;
281  }
void swap(value_ptr &other) noexcept
Definition: value_ptr.h:309
Float_t tmp
Definition: plot.C:36
constexpr value_ptr() noexcept
Definition: value_ptr.h:204
template<class Element, class Cloner, class Deleter>
pointer cet::value_ptr< Element, Cloner, Deleter >::release ( )
inlinenoexcept

Definition at line 296 of file value_ptr.h.

297  {
298  pointer old = p;
299  p = nullptr;
300  return old;
301  }
const char * p
Definition: xmltok.h:285
typename std::add_pointer< Element >::type pointer
Definition: value_ptr.h:192
template<class Element, class Cloner, class Deleter>
void cet::value_ptr< Element, Cloner, Deleter >::reset ( pointer  t = pointer())
inlinenoexcept

Definition at line 303 of file value_ptr.h.

304  {
305  std::swap(p, t);
306  Deleter()(t);
307  }
const char * p
Definition: xmltok.h:285
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
template<class Element, class Cloner, class Deleter>
void cet::value_ptr< Element, Cloner, Deleter >::swap ( value_ptr< Element, Cloner, Deleter > &  other)
inlinenoexcept

Definition at line 309 of file value_ptr.h.

310  {
311  std::swap(p, other.p);
312  }
const char * p
Definition: xmltok.h:285
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)

Member Data Documentation

template<class Element, class Cloner, class Deleter>
pointer cet::value_ptr< Element, Cloner, Deleter >::p
private

Definition at line 315 of file value_ptr.h.

Referenced by cet::value_ptr< TFile >::value_ptr().


The documentation for this class was generated from the following file: