CMS 3D CMS Logo

Public Member Functions | Private Attributes

FWEvePtr< T > Class Template Reference

#include <Fireworks/Core/interface/FWEvePtr.h>

List of all members.

Public Member Functions

void destroyElement ()
 FWEvePtr ()
 FWEvePtr (T *iElement)
T * get () const
 operator bool () const
T & operator* () const
T * operator-> () const
void reset (T *iNew)
void reset ()
void swap (FWEvePtr< T > &iOther)

Private Attributes

boost::shared_ptr< TEveElement > m_container

Detailed Description

template<typename T>
class FWEvePtr< T >

Description: Smart pointer which properly deals with TEveElement reference counting

Usage: <usage>

Definition at line 31 of file FWEvePtr.h.


Constructor & Destructor Documentation

template<typename T>
FWEvePtr< T >::FWEvePtr ( ) [inline]

Definition at line 34 of file FWEvePtr.h.

              {
   }
template<typename T>
FWEvePtr< T >::FWEvePtr ( T *  iElement) [inline, explicit]

Definition at line 36 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

                                  : m_container(new TEveElementList()) {
      m_container->AddElement(iElement);
   }

Member Function Documentation

template<typename T>
void FWEvePtr< T >::destroyElement ( ) [inline]

Definition at line 66 of file FWEvePtr.h.

References FWEvePtr< T >::m_container, and FWEvePtr< T >::reset().

                         {
      if(m_container) {m_container->DestroyElements();}
      reset();
   }
template<typename T>
T* FWEvePtr< T >::get ( void  ) const [inline]

Definition at line 49 of file FWEvePtr.h.

References cmsCodeRules::cppFunctionSkipper::operator.

                  {
      return (operator->());
   }
template<typename T>
FWEvePtr< T >::operator bool ( ) const [inline]

Definition at line 53 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

                         {
      return m_container && m_container->HasChildren();
   }
template<typename T>
T& FWEvePtr< T >::operator* ( void  ) const [inline]

Definition at line 45 of file FWEvePtr.h.

References FWEvePtr< T >::operator->().

                        {
      return *(operator->());
   }
template<typename T>
T* FWEvePtr< T >::operator-> ( ) const [inline]

Definition at line 40 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

Referenced by FWEvePtr< T >::operator*().

                         {
      return m_container && m_container->HasChildren() ?
             static_cast<T*>(m_container->FirstChild()) :
             static_cast<T*>(0);
   }
template<typename T>
void FWEvePtr< T >::reset ( void  ) [inline]

Definition at line 59 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

Referenced by FWEvePtr< T >::destroyElement().

                {
      m_container.reset();
   }
template<typename T>
void FWEvePtr< T >::reset ( T *  iNew) [inline]

Definition at line 62 of file FWEvePtr.h.

References FWEvePtr< T >::swap(), and cond::rpcobtemp::temp.

                       {
      FWEvePtr<T> temp(iNew);
      swap(temp);
   }
template<typename T>
void FWEvePtr< T >::swap ( FWEvePtr< T > &  iOther) [inline]

Definition at line 71 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

Referenced by FWEvePtr< T >::reset().

                                  {
      m_container.swap(iOther.m_container);
   }

Member Data Documentation

template<typename T>
boost::shared_ptr<TEveElement> FWEvePtr< T >::m_container [private]