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

◆ FWEvePtr() [1/2]

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

Definition at line 32 of file FWEvePtr.h.

32 {}

◆ FWEvePtr() [2/2]

template<typename T>
FWEvePtr< T >::FWEvePtr ( T iElement)
inlineexplicit

Definition at line 33 of file FWEvePtr.h.

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

References FWEvePtr< T >::m_container.

Member Function Documentation

◆ destroyElement()

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

Definition at line 51 of file FWEvePtr.h.

51  {
52  if (m_container) {
53  m_container->DestroyElements();
54  }
55  reset();
56  }

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

◆ get()

template<typename T>
T* FWEvePtr< T >::get ( ) const
inline

◆ operator bool()

template<typename T>
FWEvePtr< T >::operator bool ( ) const
inline

Definition at line 42 of file FWEvePtr.h.

42 { return m_container && m_container->HasChildren(); }

References FWEvePtr< T >::m_container.

◆ operator*()

template<typename T>
T& FWEvePtr< T >::operator* ( void  ) const
inline

Definition at line 38 of file FWEvePtr.h.

38 { return *(operator->()); }

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

◆ operator->()

template<typename T>
T* FWEvePtr< T >::operator-> ( ) const
inline

Definition at line 35 of file FWEvePtr.h.

35  {
36  return m_container && m_container->HasChildren() ? static_cast<T*>(m_container->FirstChild()) : static_cast<T*>(0);
37  }

References FWEvePtr< T >::m_container.

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

◆ reset() [1/2]

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

Definition at line 46 of file FWEvePtr.h.

46 { m_container.reset(); }

References FWEvePtr< T >::m_container.

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

◆ reset() [2/2]

template<typename T>
void FWEvePtr< T >::reset ( T iNew)
inline

Definition at line 47 of file FWEvePtr.h.

47  {
48  FWEvePtr<T> temp(iNew);
49  swap(temp);
50  }

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

◆ swap()

template<typename T>
void FWEvePtr< T >::swap ( FWEvePtr< T > &  iOther)
inline

Definition at line 58 of file FWEvePtr.h.

58 { m_container.swap(iOther.m_container); }

References FWEvePtr< T >::m_container.

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

Member Data Documentation

◆ m_container

template<typename T>
std::shared_ptr<TEveElement> FWEvePtr< T >::m_container
private
FWEvePtr
Definition: FWEvePtr.h:30
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
FWEvePtr::operator->
T * operator->() const
Definition: FWEvePtr.h:35
FWEvePtr::swap
void swap(FWEvePtr< T > &iOther)
Definition: FWEvePtr.h:58
Utilities.operator
operator
Definition: Utilities.py:24
FWEvePtr::reset
void reset()
Definition: FWEvePtr.h:46
FWEvePtr::m_container
std::shared_ptr< TEveElement > m_container
Definition: FWEvePtr.h:66