CMS 3D CMS Logo

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

std::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 32 of file FWEvePtr.h.

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

Definition at line 33 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

33 : m_container(new TEveElementList()) { m_container->AddElement(iElement); }
std::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:66

Member Function Documentation

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

Definition at line 51 of file FWEvePtr.h.

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

51  {
52  if (m_container) {
53  m_container->DestroyElements();
54  }
55  reset();
56  }
std::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:66
void reset()
Definition: FWEvePtr.h:46
template<typename T>
T* FWEvePtr< T >::get ( ) const
inline
template<typename T>
FWEvePtr< T >::operator bool ( ) const
inline

Definition at line 42 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

42 { return m_container && m_container->HasChildren(); }
std::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:66
template<typename T>
T& FWEvePtr< T >::operator* ( void  ) const
inline

Definition at line 38 of file FWEvePtr.h.

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

38 { return *(operator->()); }
T * operator->() const
Definition: FWEvePtr.h:35
template<typename T>
T* FWEvePtr< T >::operator-> ( ) const
inline

Definition at line 35 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

35  {
36  return m_container && m_container->HasChildren() ? static_cast<T*>(m_container->FirstChild()) : static_cast<T*>(0);
37  }
std::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:66
long double T
template<typename T>
void FWEvePtr< T >::reset ( void  )
inline

Definition at line 46 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

46 { m_container.reset(); }
std::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:66
template<typename T>
void FWEvePtr< T >::reset ( T iNew)
inline

Definition at line 47 of file FWEvePtr.h.

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

47  {
48  FWEvePtr<T> temp(iNew);
49  swap(temp);
50  }
void swap(FWEvePtr< T > &iOther)
Definition: FWEvePtr.h:58
template<typename T>
void FWEvePtr< T >::swap ( FWEvePtr< T > &  iOther)
inline

Definition at line 58 of file FWEvePtr.h.

References FWEvePtr< T >::m_container.

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

58 { m_container.swap(iOther.m_container); }
std::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:66

Member Data Documentation

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