Holder of TObject instance.
Should not be used very often, while ownership is undefined for it
Definition at line 25 of file TObjectHolder.hxx.
Public Member Functions | |
| TObjectHolder (TObject *obj, bool owner=false) | |
| virtual | ~TObjectHolder () |
| void | Forget () final |
| Clear all pointers without performing cleanup. | |
| const TClass * | GetClass () const final |
| Returns class of contained object. | |
| const void * | GetObject () const final |
| Returns direct (temporary) object pointer. | |
Public Member Functions inherited from ROOT::Browsable::RHolder | |
| 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. | |
| template<class T > | |
| bool | InheritsFrom () const |
Protected Member Functions | |
| void * | AccessObject () final |
| Returns plain object pointer without care about ownership, should not be used often. | |
| void | ClearROOTOwnership (TObject *obj) |
| Check if object is not registered in some global lists Prevent double deletion. | |
| RHolder * | DoCopy () const final |
| Create copy of container, works only when pointer can be shared. | |
| void * | TakeObject () final |
| Return TObject instance with ownership If object is not owned by the holder, it will be cloned (except TDirectory or TTree classes) | |
Protected Member Functions inherited from ROOT::Browsable::RHolder | |
| virtual void * | GetShared () const |
| Returns pointer on existing shared_ptr<T> | |
Private Attributes | |
| void * | fAdjusted {nullptr} |
| ! pointer on real class returned by fObj->IsA() | |
| TObject * | fObj {nullptr} |
| ! plain holder without IO | |
| bool | fOwner {false} |
| ! is TObject owner | |
#include <ROOT/Browsable/TObjectHolder.hxx>
Definition at line 35 of file TObjectHolder.hxx.
|
inlinevirtual |
Definition at line 48 of file TObjectHolder.hxx.
|
inlinefinalprotectedvirtual |
Returns plain object pointer without care about ownership, should not be used often.
Reimplemented from ROOT::Browsable::RHolder.
Definition at line 30 of file TObjectHolder.hxx.
|
protected |
Check if object is not registered in some global lists Prevent double deletion.
Definition at line 20 of file TObjectHolder.cxx.
|
inlinefinalprotectedvirtual |
Create copy of container, works only when pointer can be shared.
Reimplemented from ROOT::Browsable::RHolder.
Definition at line 32 of file TObjectHolder.hxx.
|
inlinefinalvirtual |
Clear all pointers without performing cleanup.
Reimplemented from ROOT::Browsable::RHolder.
Definition at line 53 of file TObjectHolder.hxx.
Returns class of contained object.
Implements ROOT::Browsable::RHolder.
Definition at line 59 of file TObjectHolder.hxx.
|
inlinefinalvirtual |
Returns direct (temporary) object pointer.
Implements ROOT::Browsable::RHolder.
Definition at line 60 of file TObjectHolder.hxx.
|
finalprotectedvirtual |
Return TObject instance with ownership If object is not owned by the holder, it will be cloned (except TDirectory or TTree classes)
Reimplemented from ROOT::Browsable::RHolder.
Definition at line 37 of file TObjectHolder.cxx.
|
private |
! pointer on real class returned by fObj->IsA()
Definition at line 27 of file TObjectHolder.hxx.
|
private |
! plain holder without IO
Definition at line 26 of file TObjectHolder.hxx.
! is TObject owner
Definition at line 28 of file TObjectHolder.hxx.