CMS 3D CMS Logo

Public Member Functions | Private Member Functions

ora::NamedRef< T > Class Template Reference

#include <NamedRef.h>

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

List of all members.

Public Member Functions

T * get () const
 NamedRef (const std::string &name)
template<typename C >
 NamedRef (const std::string &name, boost::shared_ptr< C > &data)
 NamedRef (const NamedRef< T > &rhs)
 NamedRef ()
 NamedRef (const std::string &name, boost::shared_ptr< T > &data)
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
T & operator* () const
T * operator-> () const
template<typename C >
NamedRef< T > & operator= (const NamedRef< C > &rhs)
NamedRef< T > & operator= (const NamedRef< T > &rhs)
template<class C >
bool operator== (const NamedRef< C > &rhs) const
bool operator== (const NamedRef< T > &rhs) const
boost::shared_ptr< T > share () const
virtual ~NamedRef ()

Private Member Functions

T * safePtr (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.

template<class T >
ora::NamedRef< T >::NamedRef ( const std::string &  name) [inline]

Definition at line 65 of file NamedRef.h.

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.

                                                                                 :
  NamedReference( name, boost::shared_ptr<void>( data ) ){}
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.

                                                                                 :
  NamedReference( name, boost::shared_ptr<void>( data )){
}
template<class T >
ora::NamedRef< T >::NamedRef ( const NamedRef< T > &  rhs) [inline]

Definition at line 79 of file NamedRef.h.

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

Definition at line 85 of file NamedRef.h.

                                                      :
  NamedReference( rhs.name() ){
}
template<class T >
ora::NamedRef< T >::~NamedRef ( ) [inline, virtual]

Definition at line 90 of file NamedRef.h.

                                 {
}

Member Function Documentation

template<class T >
T * ora::NamedRef< T >::get ( void  ) const [inline]

Definition at line 129 of file NamedRef.h.

                                     {
  return safePtr(false);  
}
template<class T >
ora::NamedRef< T >::operator bool ( ) const [inline]

Definition at line 124 of file NamedRef.h.

                                           {
  return safePtr(false);
}
template<class T >
bool ora::NamedRef< T >::operator! ( ) const [inline]

Definition at line 139 of file NamedRef.h.

                                            {
  return safePtr(false)==0;
}
template<class T >
bool ora::NamedRef< T >::operator!= ( const NamedRef< T > &  rhs) const

Definition at line 149 of file NamedRef.h.

References operator==().

                                                             {
  return !(this->operator==(rhs));     
}
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==().

                                                             {
  return !(this->operator==(rhs));     
}
template<class T >
T & ora::NamedRef< T >::operator* ( ) const [inline]

Definition at line 119 of file NamedRef.h.

                                          {
  return *safePtr( true );
}
template<class T >
T * ora::NamedRef< T >::operator-> ( ) const [inline]

Definition at line 114 of file NamedRef.h.

                                           {
  return safePtr( true );
}
template<class 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=().

                                                                        {
  NamedReference::operator=( rhs );
  return *this;  
}
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=().

                                                                       {
  NamedReference::operator=( rhs );
  return *this;  
}
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().

                                                            {
  return share() == rhs.share();
}
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().

                                                            {
  return share() == rhs.share();
}
template<class T >
T * ora::NamedRef< T >::safePtr ( bool  throw_flag) const [private]

Definition at line 107 of file NamedRef.h.

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

                                                  {
  T* p = share().get();
  if( !p && throw_flag) throwException( "Underlying pointer is null.","NamedRef::safePtr"); 
  return p;
}
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==().

                                                      {
  return boost::static_pointer_cast<T>(ptr());
}