Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Browsable::RShared< T > Class Template Reference

template<class T>
class ROOT::Browsable::RShared< T >

Definition at line 26 of file RShared.hxx.

Public Member Functions

 RShared (std::shared_ptr< T > &&obj)
 RShared (std::shared_ptr< T > obj)
 RShared (T *obj)
virtual ~RShared ()=default
template<class T>
bool CanCastTo () const
auto Copy () const
 Clone container.
virtual void Forget ()
 Clear all pointers without performing cleanup.
template<class T>
const T * Get () const
 Returns direct object pointer cast to provided class.
template<class T>
T * get_object ()
 Returns plains pointer on object without ownership, only can be used for TObjects.
template<class T>
std::shared_ptr< T > get_shared ()
 Returns shared_ptr of contained object.
template<class T>
std::unique_ptr< T > get_unique ()
 Returns unique_ptr of contained object.
const TClassGetClass () const final
 Returns class of contained object.
const void * GetObject () const final
 Returns direct (temporary) object pointer.
template<class T>
bool InheritsFrom () const

Protected Member Functions

virtual void * AccessObject ()
 Returns plain object pointer without care about ownership, should not be used often.
RHolderDoCopy () const final
 Create copy of container, works only when pointer can be shared.
void * GetShared () const final
 Returns pointer on existing shared_ptr<T>.
virtual void * TakeObject ()
 Returns pointer with ownership, normally via unique_ptr<T>::release() or tobj->Clone().

Private Attributes

std::shared_ptr< T > fShared
 ! holder without IO

#include <ROOT/Browsable/RShared.hxx>

Inheritance diagram for ROOT::Browsable::RShared< T >:
ROOT::Browsable::RHolder

Constructor & Destructor Documentation

◆ RShared() [1/3]

template<class T>
ROOT::Browsable::RShared< T >::RShared ( T * obj)
inline

Definition at line 32 of file RShared.hxx.

◆ RShared() [2/3]

template<class T>
ROOT::Browsable::RShared< T >::RShared ( std::shared_ptr< T > obj)
inline

Definition at line 33 of file RShared.hxx.

◆ RShared() [3/3]

template<class T>
ROOT::Browsable::RShared< T >::RShared ( std::shared_ptr< T > && obj)
inline

Definition at line 34 of file RShared.hxx.

◆ ~RShared()

template<class T>
virtual ROOT::Browsable::RShared< T >::~RShared ( )
virtualdefault

Member Function Documentation

◆ AccessObject()

virtual void * ROOT::Browsable::RHolder::AccessObject ( )
inlineprotectedvirtualinherited

Returns plain object pointer without care about ownership, should not be used often.

Reimplemented in ROOT::Browsable::RAnyObjectHolder, and ROOT::Browsable::TObjectHolder.

Definition at line 43 of file RHolder.hxx.

◆ CanCastTo()

template<class T>
bool ROOT::Browsable::RHolder::CanCastTo ( ) const
inlineinherited

Definition at line 67 of file RHolder.hxx.

◆ Copy()

auto ROOT::Browsable::RHolder::Copy ( ) const
inlineinherited

Clone container.

Trivial for shared_ptr and TObject holder, does not work for unique_ptr

Definition at line 85 of file RHolder.hxx.

◆ DoCopy()

template<class T>
RHolder * ROOT::Browsable::RShared< T >::DoCopy ( ) const
inlinefinalprotectedvirtual

Create copy of container, works only when pointer can be shared.

Reimplemented from ROOT::Browsable::RHolder.

Definition at line 30 of file RShared.hxx.

◆ Forget()

virtual void ROOT::Browsable::RHolder::Forget ( )
inlinevirtualinherited

Clear all pointers without performing cleanup.

Reimplemented in ROOT::Browsable::RAnyObjectHolder, and ROOT::Browsable::TObjectHolder.

Definition at line 58 of file RHolder.hxx.

◆ Get()

template<class T>
const T * ROOT::Browsable::RHolder::Get ( ) const
inlineinherited

Returns direct object pointer cast to provided class.

Definition at line 75 of file RHolder.hxx.

◆ get_object()

template<class T>
T * ROOT::Browsable::RHolder::get_object ( )
inlineinherited

Returns plains pointer on object without ownership, only can be used for TObjects.

Definition at line 121 of file RHolder.hxx.

◆ get_shared()

template<class T>
std::shared_ptr< T > ROOT::Browsable::RHolder::get_shared ( )
inlineinherited

Returns shared_ptr of contained object.

Definition at line 106 of file RHolder.hxx.

◆ get_unique()

template<class T>
std::unique_ptr< T > ROOT::Browsable::RHolder::get_unique ( )
inlineinherited

Returns unique_ptr of contained object.

Definition at line 89 of file RHolder.hxx.

◆ GetClass()

template<class T>
const TClass * ROOT::Browsable::RShared< T >::GetClass ( ) const
inlinefinalvirtual

Returns class of contained object.

Implements ROOT::Browsable::RHolder.

Definition at line 37 of file RShared.hxx.

◆ GetObject()

template<class T>
const void * ROOT::Browsable::RShared< T >::GetObject ( ) const
inlinefinalvirtual

Returns direct (temporary) object pointer.

Implements ROOT::Browsable::RHolder.

Definition at line 38 of file RShared.hxx.

◆ GetShared()

template<class T>
void * ROOT::Browsable::RShared< T >::GetShared ( ) const
inlinefinalprotectedvirtual

Returns pointer on existing shared_ptr<T>.

Reimplemented from ROOT::Browsable::RHolder.

Definition at line 29 of file RShared.hxx.

◆ InheritsFrom()

template<class T>
bool ROOT::Browsable::RHolder::InheritsFrom ( ) const
inlineinherited

Definition at line 61 of file RHolder.hxx.

◆ TakeObject()

virtual void * ROOT::Browsable::RHolder::TakeObject ( )
inlineprotectedvirtualinherited

Returns pointer with ownership, normally via unique_ptr<T>::release() or tobj->Clone().

Reimplemented in ROOT::Browsable::RAnyObjectHolder, ROOT::Browsable::RUnique< T >, and ROOT::Browsable::TObjectHolder.

Definition at line 40 of file RHolder.hxx.

Member Data Documentation

◆ fShared

template<class T>
std::shared_ptr<T> ROOT::Browsable::RShared< T >::fShared
private

! holder without IO

Definition at line 27 of file RShared.hxx.


The documentation for this class was generated from the following file: