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 Attributes
FWEvePtr< T > Class Template Reference

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

Public Member Functions

void destroyElement ()
 
 FWEvePtr ()
 
 FWEvePtr (T *iElement)
 
Tget () const
 
 operator bool () const
 
Toperator* () const
 
Toperator-> () const
 
void reset ()
 
void reset (T *iNew)
 
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 30 of file FWEvePtr.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file FWEvePtr.h.

33  {
34  }
template<typename T>
FWEvePtr< T >::FWEvePtr ( T iElement)
inlineexplicit

Definition at line 35 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

35  : m_container(new TEveElementList()) {
36  m_container->AddElement(iElement);
37  }
boost::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:79

Member Function Documentation

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

Definition at line 65 of file FWEvePtr.h.

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

65  {
66  if(m_container) {m_container->DestroyElements();}
67  reset();
68  }
void reset()
Definition: FWEvePtr.h:58
boost::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:79
template<typename T>
T* FWEvePtr< T >::get ( void  ) const
inline
template<typename T>
FWEvePtr< T >::operator bool ( ) const
inline

Definition at line 52 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

52  {
53  return m_container && m_container->HasChildren();
54  }
boost::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:79
template<typename T>
T& FWEvePtr< T >::operator* ( void  ) const
inline

Definition at line 44 of file FWEvePtr.h.

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

44  {
45  return *(operator->());
46  }
T * operator->() const
Definition: FWEvePtr.h:39
template<typename T>
T* FWEvePtr< T >::operator-> ( ) const
inline

Definition at line 39 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

39  {
40  return m_container && m_container->HasChildren() ?
41  static_cast<T*>(m_container->FirstChild()) :
42  static_cast<T*>(0);
43  }
boost::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:79
long double T
template<typename T>
void FWEvePtr< T >::reset ( void  )
inline

Definition at line 58 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

58  {
59  m_container.reset();
60  }
boost::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:79
template<typename T>
void FWEvePtr< T >::reset ( T iNew)
inline

Definition at line 61 of file FWEvePtr.h.

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

61  {
62  FWEvePtr<T> temp(iNew);
63  swap(temp);
64  }
void swap(FWEvePtr< T > &iOther)
Definition: FWEvePtr.h:70
template<typename T>
void FWEvePtr< T >::swap ( FWEvePtr< T > &  iOther)
inline

Definition at line 70 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

70  {
71  m_container.swap(iOther.m_container);
72  }
boost::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:79

Member Data Documentation

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