9#ifndef ROOT7_Browsable_RHolder
10#define ROOT7_Browsable_RHolder
79 return (
const T *) ((
char *)
GetObject() + offset);
85 auto Copy()
const {
return std::unique_ptr<RHolder>(
DoCopy()); }
97 std::unique_ptr<T> unique;
98 unique.reset((T *)((
char *) pobj + offset));
113 return *(
static_cast<std::shared_ptr<T> *
>(pshared));
Basic class for object holder of any kind.
auto Copy() const
Clone container.
virtual void Forget()
Clear all pointers without performing cleanup.
virtual const TClass * GetClass() const =0
Returns class of contained object.
virtual void * GetShared() const
Returns pointer on existing shared_ptr<T>.
virtual void * AccessObject()
Returns plain object pointer without care about ownership, should not be used often.
std::shared_ptr< T > get_shared()
Returns shared_ptr of contained object.
std::unique_ptr< T > get_unique()
Returns unique_ptr of contained object.
virtual void * TakeObject()
Returns pointer with ownership, normally via unique_ptr<T>::release() or tobj->Clone().
virtual RHolder * DoCopy() const
Create copy of container, works only when pointer can be shared.
virtual const void * GetObject() const =0
Returns direct (temporary) object pointer.
virtual ~RHolder()=default
T * get_object()
Returns plains pointer on object without ownership, only can be used for TObjects.
const T * Get() const
Returns direct object pointer cast to provided class.
bool InheritsFrom() const
A log configuration for a channel, e.g.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
ROOT::RLogChannel & BrowsableLog()
Log channel for Browsable diagnostics.