CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
ProxyBase11< T > Class Template Reference

#include <ProxyBase11.h>

Inheritance diagram for ProxyBase11< T >:
TrajectoryStateOnSurface

Public Types

using pointer = std::shared_ptr< T >
 

Public Member Functions

void check () const
 
const Tdata () const
 
void destroy ()
 
bool isValid () const
 
template<typename U >
ProxyBase11operator= (std::shared_ptr< U > p)
 
ProxyBase11operator= (ProxyBase11 &&other)=default
 
ProxyBase11operator= (const ProxyBase11 &other)=default
 
 ProxyBase11 ()
 
 ProxyBase11 (T *p)
 
template<typename U >
 ProxyBase11 (std::shared_ptr< U > p)
 
 ProxyBase11 (ProxyBase11 &&other)=default
 
 ProxyBase11 (ProxyBase11 const &other)=default
 
int references () const
 
void reset ()
 
TsharedData ()
 
void swap (ProxyBase11 &other)
 
TunsharedData ()
 
 ~ProxyBase11 ()
 

Private Attributes

std::shared_ptr< TtheData
 

Detailed Description

template<class T>
class ProxyBase11< T >

A base class for reference counting proxies. The class to which this one is proxy must inherit from ReferenceCounted. A ProxyBase has value semantics, in contrast to ReferenceCountingPointer, which has pointer semantics. The Proxy class inheriting from ProxyBase must duplicate the part of the interface of the reference counted class that it whiches to expose.

Definition at line 21 of file ProxyBase11.h.

Member Typedef Documentation

template<class T>
using ProxyBase11< T >::pointer = std::shared_ptr<T>

Definition at line 24 of file ProxyBase11.h.

Constructor & Destructor Documentation

template<class T>
ProxyBase11< T >::ProxyBase11 ( )
inline

Definition at line 28 of file ProxyBase11.h.

28 {}
template<class T>
ProxyBase11< T >::ProxyBase11 ( T p)
inlineexplicit

Definition at line 30 of file ProxyBase11.h.

30 : theData(p) {}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
template<class T>
template<typename U >
ProxyBase11< T >::ProxyBase11 ( std::shared_ptr< U >  p)
inline

Definition at line 32 of file ProxyBase11.h.

32 : theData(std::move(p)){}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
def move
Definition: eostools.py:510
template<class T>
ProxyBase11< T >::~ProxyBase11 ( )
inline

Definition at line 36 of file ProxyBase11.h.

References ProxyBase11< T >::destroy().

36  {
37  destroy();
38  }
void destroy()
Definition: ProxyBase11.h:72
template<class T>
ProxyBase11< T >::ProxyBase11 ( ProxyBase11< T > &&  other)
default
template<class T>
ProxyBase11< T >::ProxyBase11 ( ProxyBase11< T > const &  other)
default

Member Function Documentation

template<class T>
void ProxyBase11< T >::check ( void  ) const
inline

Definition at line 65 of file ProxyBase11.h.

References ProxyBase11< T >::theData, and unlikely.

Referenced by ProxyBase11< T >::data(), ProxyBase11< T >::sharedData(), and ProxyBase11< T >::unsharedData().

65  {
66 #ifdef TR_DEBUG
67  if unlikely(!theData)
68  throw TrajectoryStateException("Error: uninitialized ProxyBase11 used");
69 #endif
70  }
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
#define unlikely(x)
template<class T>
const T& ProxyBase11< T >::data ( ) const
inline
template<class T>
void ProxyBase11< T >::destroy ( )
inline

Definition at line 72 of file ProxyBase11.h.

Referenced by ProxyBase11< T >::~ProxyBase11().

72 {}
template<class T>
bool ProxyBase11< T >::isValid ( void  ) const
inline

Definition at line 63 of file ProxyBase11.h.

References ProxyBase11< T >::theData.

Referenced by TrajectoryStateOnSurface::isValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

63 { return bool(theData);}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
template<class T>
template<typename U >
ProxyBase11& ProxyBase11< T >::operator= ( std::shared_ptr< U >  p)
inline

Definition at line 34 of file ProxyBase11.h.

References eostools::move(), and ProxyBase11< T >::theData.

Referenced by TrajectoryStateOnSurface::operator=().

34 { theData =std::move(p); return *this;}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
def move
Definition: eostools.py:510
template<class T>
ProxyBase11& ProxyBase11< T >::operator= ( ProxyBase11< T > &&  other)
default
template<class T>
ProxyBase11& ProxyBase11< T >::operator= ( const ProxyBase11< T > &  other)
default
template<class T>
int ProxyBase11< T >::references ( ) const
inline

Definition at line 73 of file ProxyBase11.h.

References ProxyBase11< T >::theData.

Referenced by ProxyBase11< T >::unsharedData().

73 {return theData.use_count();}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
template<class T>
void ProxyBase11< T >::reset ( void  )
inline

Definition at line 49 of file ProxyBase11.h.

References ProxyBase11< T >::theData.

Referenced by MultiHitGeneratorFromChi2::hitSets().

49 { theData.reset();}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
template<class T>
T& ProxyBase11< T >::sharedData ( )
inline

Definition at line 61 of file ProxyBase11.h.

References ProxyBase11< T >::check(), and ProxyBase11< T >::theData.

Referenced by TrajectoryStateOnSurface::setCurvilinearError().

61 { check(); return *theData;}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
void check() const
Definition: ProxyBase11.h:65
template<class T>
void ProxyBase11< T >::swap ( ProxyBase11< T > &  other)
inline

Definition at line 40 of file ProxyBase11.h.

References std::swap(), and ProxyBase11< T >::theData.

Referenced by TrajectoryStateOnSurface::operator=(), and TrajectoryStateOnSurface::swap().

40  {
41  std::swap(theData,other.theData);
42  }
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
template<class T>
T& ProxyBase11< T >::unsharedData ( )
inline

Definition at line 53 of file ProxyBase11.h.

References ProxyBase11< T >::check(), ProxyBase11< T >::references(), and ProxyBase11< T >::theData.

Referenced by TrajectoryStateOnSurface::rescaleError(), and TrajectoryStateOnSurface::update().

53  {
54  check();
55  if ( references() > 1) {
56  theData = theData->clone();
57  }
58  return *theData;
59  }
std::shared_ptr< T > theData
Definition: ProxyBase11.h:76
int references() const
Definition: ProxyBase11.h:73
void check() const
Definition: ProxyBase11.h:65

Member Data Documentation

template<class T>
std::shared_ptr<T> ProxyBase11< T >::theData
private