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

typedef Tpointer
 

Public Member Functions

void check () const
 
const Tdata () const
 
void destroy ()
 
bool isValid () const
 
ProxyBase11operator= (const ProxyBase11 &other)
 
 ProxyBase11 ()
 
 ProxyBase11 (T *p)
 
 ProxyBase11 (const ProxyBase11 &other)
 
int references () const
 
void reset ()
 
TsharedData ()
 
void swap (ProxyBase11 &other)
 
TunsharedData ()
 
 ~ProxyBase11 ()
 

Private Attributes

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 23 of file ProxyBase11.h.

Member Typedef Documentation

template<class T>
typedef T* ProxyBase11< T >::pointer

Definition at line 27 of file ProxyBase11.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file ProxyBase11.h.

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

Definition at line 36 of file ProxyBase11.h.

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

Definition at line 44 of file ProxyBase11.h.

References ProxyBase11< T >::destroy().

44  {
45  destroy();
46  }
void destroy()
Definition: ProxyBase11.h:87
template<class T>
ProxyBase11< T >::ProxyBase11 ( const ProxyBase11< T > &  other)
inline

Definition at line 56 of file ProxyBase11.h.

56 {}

Member Function Documentation

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

Definition at line 80 of file ProxyBase11.h.

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

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

80  {
81 #ifdef TR_DEBUG
82  if unlikely(!theData)
83  throw TrajectoryStateException("Error: uninitialized ProxyBase11 used");
84 #endif
85  }
#define unlikely(x)
template<class T>
const T& ProxyBase11< T >::data ( ) const
inline
template<class T>
void ProxyBase11< T >::destroy ( )
inline

Definition at line 87 of file ProxyBase11.h.

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

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

Definition at line 78 of file ProxyBase11.h.

References ProxyBase11< T >::theData.

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

78 { return bool(theData);}
template<class T>
ProxyBase11& ProxyBase11< T >::operator= ( const ProxyBase11< T > &  other)
inline

Definition at line 53 of file ProxyBase11.h.

53  {
54  return *this;
55  }
template<class T>
int ProxyBase11< T >::references ( ) const
inline

Definition at line 91 of file ProxyBase11.h.

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

91 { return 0;}
template<class T>
void ProxyBase11< T >::reset ( void  )
inline

Definition at line 64 of file ProxyBase11.h.

References ProxyBase11< T >::theData.

Referenced by MultiHitGeneratorFromChi2::hitSets().

64 { theData.reset();}
template<class T>
T& ProxyBase11< T >::sharedData ( )
inline

Definition at line 76 of file ProxyBase11.h.

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

Referenced by TrajectoryStateOnSurface::setCurvilinearError().

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

Definition at line 48 of file ProxyBase11.h.

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

Referenced by TrajectoryStateOnSurface::swap().

48  {
49  std::swap(theData,other.theData);
50  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
template<class T>
T& ProxyBase11< T >::unsharedData ( )
inline

Definition at line 68 of file ProxyBase11.h.

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

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

68  {
69  check();
70  if ( references() > 1) {
71  theData = theData->clone();
72  }
73  return *theData;
74  }
int references() const
Definition: ProxyBase11.h:91
void check() const
Definition: ProxyBase11.h:80

Member Data Documentation

template<class T>
T* ProxyBase11< T >::theData
private