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 31 of file FWEvePtr.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file FWEvePtr.h.

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

Definition at line 36 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

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().

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

Definition at line 53 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

Definition at line 45 of file FWEvePtr.h.

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

45  {
46  return *(operator->());
47  }
T * operator->() const
Definition: FWEvePtr.h:40
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*().

40  {
41  return m_container && m_container->HasChildren() ?
42  static_cast<T*>(m_container->FirstChild()) :
43  static_cast<T*>(0);
44  }
boost::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:80
long double T
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().

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

Definition at line 62 of file FWEvePtr.h.

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

62  {
63  FWEvePtr<T> temp(iNew);
64  swap(temp);
65  }
void swap(FWEvePtr< T > &iOther)
Definition: FWEvePtr.h:71
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().

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

Member Data Documentation

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