Basic class for object holder of any kind.
Could be used to transfer shared_ptr or unique_ptr or plain pointer
Definition at line 33 of file RHolder.hxx.
Public Member Functions | |
virtual | ~RHolder ()=default |
template<class T > | |
bool | CanCastTo () const |
auto | Copy () const |
Clone container. | |
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. | |
virtual const TClass * | GetClass () const =0 |
Returns class of contained object. | |
virtual const void * | GetObject () const =0 |
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. | |
virtual RHolder * | DoCopy () const |
Create copy of container, works only when pointer can be shared. | |
virtual void * | GetShared () const |
Returns pointer on existing shared_ptr<T> | |
virtual void * | TakeObject () |
Returns pointer with ownership, normally via unique_ptr<T>::release() or tobj->Clone() | |
#include <ROOT/Browsable/RHolder.hxx>
|
virtualdefault |
|
inlineprotectedvirtual |
Returns plain object pointer without care about ownership, should not be used often.
Reimplemented in ROOT::Experimental::Browsable::RAnyObjectHolder, and ROOT::Experimental::Browsable::TObjectHolder.
Definition at line 43 of file RHolder.hxx.
|
inline |
Definition at line 64 of file RHolder.hxx.
|
inline |
Clone container.
Trivial for shared_ptr and TObject holder, does not work for unique_ptr
Definition at line 81 of file RHolder.hxx.
|
inlineprotectedvirtual |
Create copy of container, works only when pointer can be shared.
Reimplemented in ROOT::Experimental::Browsable::RAnyObjectHolder, ROOT::Experimental::Browsable::RShared< T >, and ROOT::Experimental::Browsable::TObjectHolder.
Definition at line 46 of file RHolder.hxx.
|
inline |
Returns direct object pointer cast to provided class.
Definition at line 72 of file RHolder.hxx.
|
inline |
Returns plains pointer on object without ownership, only can be used for TObjects.
Definition at line 117 of file RHolder.hxx.
|
inline |
Returns shared_ptr of contained object.
Definition at line 102 of file RHolder.hxx.
|
inline |
Returns unique_ptr of contained object.
Definition at line 86 of file RHolder.hxx.
|
pure virtual |
Returns class of contained object.
Implemented in ROOT::Experimental::Browsable::RAnyObjectHolder, ROOT::Experimental::Browsable::RShared< T >, ROOT::Experimental::Browsable::RUnique< T >, ROOT::Experimental::Browsable::TObjectHolder, and RFieldHolder.
|
pure virtual |
Returns direct (temporary) object pointer.
Implemented in ROOT::Experimental::Browsable::RAnyObjectHolder, ROOT::Experimental::Browsable::RShared< T >, ROOT::Experimental::Browsable::RUnique< T >, ROOT::Experimental::Browsable::TObjectHolder, and RFieldHolder.
|
inlineprotectedvirtual |
Returns pointer on existing shared_ptr<T>
Reimplemented in ROOT::Experimental::Browsable::RShared< T >.
Definition at line 37 of file RHolder.hxx.
|
inline |
Definition at line 58 of file RHolder.hxx.
|
inlineprotectedvirtual |
Returns pointer with ownership, normally via unique_ptr<T>::release() or tobj->Clone()
Reimplemented in ROOT::Experimental::Browsable::RAnyObjectHolder, ROOT::Experimental::Browsable::RUnique< T >, and ROOT::Experimental::Browsable::TObjectHolder.
Definition at line 40 of file RHolder.hxx.