test
CMS 3D CMS Logo

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

#include <NamedRef.h>

Inheritance diagram for ora::NamedRef< T >:
ora::NamedReference

Public Member Functions

Tget () const
 
 NamedRef ()
 
 NamedRef (const std::string &name)
 
 NamedRef (const std::string &name, boost::shared_ptr< T > &data)
 
template<typename C >
 NamedRef (const std::string &name, boost::shared_ptr< C > &data)
 
 NamedRef (const NamedRef< T > &rhs)
 
template<typename C >
 NamedRef (const NamedRef< C > &rhs)
 
 operator bool () const
 
bool operator! () const
 
bool operator!= (const NamedRef< T > &rhs) const
 
template<class C >
bool operator!= (const NamedRef< C > &rhs) const
 
Toperator* () const
 
Toperator-> () const
 
NamedRef< T > & operator= (const NamedRef< T > &rhs)
 
template<typename C >
NamedRef< T > & operator= (const NamedRef< C > &rhs)
 
template<class C >
ora::NamedRef< T > & operator= (const NamedRef< C > &rhs)
 
bool operator== (const NamedRef< T > &rhs) const
 
template<class C >
bool operator== (const NamedRef< C > &rhs) const
 
boost::shared_ptr< Tshare () const
 
virtual ~NamedRef ()
 
- Public Member Functions inherited from ora::NamedReference
bool isPersistent () const
 
const std::string & name () const
 
 NamedReference ()
 
 NamedReference (const std::string &name)
 
 NamedReference (const std::string &name, boost::shared_ptr< void > ptr)
 
 NamedReference (const NamedReference &rhs)
 
NamedReferenceoperator= (const NamedReference &rhs)
 
boost::shared_ptr< void > & ptr () const
 
void reset ()
 
void set (const std::string &name)
 
virtual ~NamedReference ()
 

Private Member Functions

TsafePtr (bool throw_flag) const
 

Detailed Description

template<typename T>
class ora::NamedRef< T >

Definition at line 30 of file NamedRef.h.

Constructor & Destructor Documentation

template<class T >
ora::NamedRef< T >::NamedRef ( )
inline

Definition at line 61 of file NamedRef.h.

61  :
62  NamedReference(){}
template<class T >
ora::NamedRef< T >::NamedRef ( const std::string &  name)
inline

Definition at line 65 of file NamedRef.h.

65  :
66  NamedReference( name ){}
const std::string & name() const
Definition: NamedRef.cc:36
template<class T >
ora::NamedRef< T >::NamedRef ( const std::string &  name,
boost::shared_ptr< T > &  data 
)
inline

Definition at line 69 of file NamedRef.h.

69  :
70  NamedReference( name, boost::shared_ptr<void>( data ) ){}
const std::string & name() const
Definition: NamedRef.cc:36
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<class T >
template<class C >
ora::NamedRef< T >::NamedRef ( const std::string &  name,
boost::shared_ptr< C > &  data 
)
inline

Definition at line 74 of file NamedRef.h.

74  :
75  NamedReference( name, boost::shared_ptr<void>( data )){
76 }
const std::string & name() const
Definition: NamedRef.cc:36
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<class T >
ora::NamedRef< T >::NamedRef ( const NamedRef< T > &  rhs)
inline

Definition at line 79 of file NamedRef.h.

79  :
80  NamedReference( rhs.name() ){
81 }
template<class T >
template<class C >
ora::NamedRef< T >::NamedRef ( const NamedRef< C > &  rhs)
inline

Definition at line 85 of file NamedRef.h.

85  :
86  NamedReference( rhs.name() ){
87 }
template<class T >
ora::NamedRef< T >::~NamedRef ( )
inlinevirtual

Definition at line 90 of file NamedRef.h.

90  {
91 }

Member Function Documentation

template<class T >
T * ora::NamedRef< T >::get ( ) const
inline
template<class T >
ora::NamedRef< T >::operator bool ( ) const
inline

Definition at line 124 of file NamedRef.h.

124  {
125  return safePtr(false);
126 }
T * safePtr(bool throw_flag) const
Definition: NamedRef.h:107
template<class T >
bool ora::NamedRef< T >::operator! ( ) const
inline

Definition at line 139 of file NamedRef.h.

139  {
140  return safePtr(false)==0;
141 }
T * safePtr(bool throw_flag) const
Definition: NamedRef.h:107
template<class T >
bool ora::NamedRef< T >::operator!= ( const NamedRef< T > &  rhs) const

Definition at line 149 of file NamedRef.h.

References operator==().

149  {
150  return !(this->operator==(rhs));
151 }
bool operator==(const NamedRef< T > &rhs) const
Definition: NamedRef.h:144
template<class T >
template<class C >
bool ora::NamedRef< T >::operator!= ( const NamedRef< C > &  rhs) const

Definition at line 161 of file NamedRef.h.

References operator==().

161  {
162  return !(this->operator==(rhs));
163 }
bool operator==(const NamedRef< T > &rhs) const
Definition: NamedRef.h:144
template<class T >
T & ora::NamedRef< T >::operator* ( ) const
inline

Definition at line 119 of file NamedRef.h.

119  {
120  return *safePtr( true );
121 }
T * safePtr(bool throw_flag) const
Definition: NamedRef.h:107
template<class T >
T * ora::NamedRef< T >::operator-> ( ) const
inline

Definition at line 114 of file NamedRef.h.

114  {
115  return safePtr( true );
116 }
T * safePtr(bool throw_flag) const
Definition: NamedRef.h:107
template<class T >
ora::NamedRef< T > & ora::NamedRef< T >::operator= ( const NamedRef< T > &  rhs)
inline

Definition at line 94 of file NamedRef.h.

References ora::NamedReference::operator=().

94  {
96  return *this;
97 }
NamedReference & operator=(const NamedReference &rhs)
Definition: NamedRef.cc:22
template<typename T>
template<typename C >
NamedRef<T>& ora::NamedRef< T >::operator= ( const NamedRef< C > &  rhs)
template<typename T>
template<class C >
ora::NamedRef<T>& ora::NamedRef< T >::operator= ( const NamedRef< C > &  rhs)
inline

Definition at line 101 of file NamedRef.h.

References ora::NamedReference::operator=().

101  {
103  return *this;
104 }
NamedReference & operator=(const NamedReference &rhs)
Definition: NamedRef.cc:22
template<class T >
bool ora::NamedRef< T >::operator== ( const NamedRef< T > &  rhs) const

Definition at line 144 of file NamedRef.h.

References ora::NamedRef< T >::share().

144  {
145  return share() == rhs.share();
146 }
boost::shared_ptr< T > share() const
Definition: NamedRef.h:134
template<class T >
template<class C >
bool ora::NamedRef< T >::operator== ( const NamedRef< C > &  rhs) const

Definition at line 155 of file NamedRef.h.

References ora::NamedRef< T >::share().

155  {
156  return share() == rhs.share();
157 }
boost::shared_ptr< T > share() const
Definition: NamedRef.h:134
template<class T >
T * ora::NamedRef< T >::safePtr ( bool  throw_flag) const
private

Definition at line 107 of file NamedRef.h.

References AlCaHLTBitMon_ParallelJobs::p, and ora::throwException().

107  {
108  T* p = share().get();
109  if( !p && throw_flag) throwException( "Underlying pointer is null.","NamedRef::safePtr");
110  return p;
111 }
boost::shared_ptr< T > share() const
Definition: NamedRef.h:134
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
long double T
template<class T >
boost::shared_ptr< T > ora::NamedRef< T >::share ( ) const
inline

Definition at line 134 of file NamedRef.h.

Referenced by ora::NamedRef< T >::operator==().

134  {
135  return boost::static_pointer_cast<T>(ptr());
136 }
boost::shared_ptr< void > & ptr() const
Definition: NamedRef.cc:44
long double T