Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Browsable::RAnyObjectHolder Class Reference

Holder of any object instance.

Normally used with TFile, where any object can be read. Normally RShread or RUnique should be used

Author
Sergey Linev S.Lin.nosp@m.ev@g.nosp@m.si.de
Date
2019-10-19
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!

Definition at line 26 of file RAnyObjectHolder.hxx.

Public Member Functions

 RAnyObjectHolder (TClass *cl, void *obj, bool owner=false)
 
virtual ~RAnyObjectHolder ()
 
const TClassGetClass () const final
 Returns class of contained object.
 
const void * GetObject () const final
 Returns direct (temporary) object pointer.
 
- Public Member Functions inherited from ROOT::Experimental::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.
 
RHolderDoCopy () const final
 Create copy of container, works only when pointer can be shared.
 
void * TakeObject () final
 Returns pointer with ownership, normally via unique_ptr<T>::release() or tobj->Clone()
 
- Protected Member Functions inherited from ROOT::Experimental::Browsable::RHolder
virtual void * GetShared () const
 Returns pointer on existing shared_ptr<T>
 

Private Attributes

TClassfClass {nullptr}
 ! object class
 
void * fObj {nullptr}
 ! plain holder without IO
 
bool fOwner {false}
 ! is object owner
 

#include <ROOT/Browsable/RAnyObjectHolder.hxx>

Inheritance diagram for ROOT::Experimental::Browsable::RAnyObjectHolder:
[legend]

Constructor & Destructor Documentation

◆ RAnyObjectHolder()

ROOT::Experimental::Browsable::RAnyObjectHolder::RAnyObjectHolder ( TClass cl,
void *  obj,
bool  owner = false 
)
inline

Definition at line 50 of file RAnyObjectHolder.hxx.

◆ ~RAnyObjectHolder()

virtual ROOT::Experimental::Browsable::RAnyObjectHolder::~RAnyObjectHolder ( )
inlinevirtual

Definition at line 51 of file RAnyObjectHolder.hxx.

Member Function Documentation

◆ AccessObject()

void * ROOT::Experimental::Browsable::RAnyObjectHolder::AccessObject ( )
inlinefinalprotectedvirtual

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

Reimplemented from ROOT::Experimental::Browsable::RHolder.

Definition at line 31 of file RAnyObjectHolder.hxx.

◆ DoCopy()

RHolder * ROOT::Experimental::Browsable::RAnyObjectHolder::DoCopy ( ) const
inlinefinalprotectedvirtual

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

Reimplemented from ROOT::Experimental::Browsable::RHolder.

Definition at line 43 of file RAnyObjectHolder.hxx.

◆ GetClass()

const TClass * ROOT::Experimental::Browsable::RAnyObjectHolder::GetClass ( ) const
inlinefinalvirtual

Returns class of contained object.

Implements ROOT::Experimental::Browsable::RHolder.

Definition at line 57 of file RAnyObjectHolder.hxx.

◆ GetObject()

const void * ROOT::Experimental::Browsable::RAnyObjectHolder::GetObject ( ) const
inlinefinalvirtual

Returns direct (temporary) object pointer.

Implements ROOT::Experimental::Browsable::RHolder.

Definition at line 58 of file RAnyObjectHolder.hxx.

◆ TakeObject()

void * ROOT::Experimental::Browsable::RAnyObjectHolder::TakeObject ( )
inlinefinalprotectedvirtual

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

Reimplemented from ROOT::Experimental::Browsable::RHolder.

Definition at line 33 of file RAnyObjectHolder.hxx.

Member Data Documentation

◆ fClass

TClass* ROOT::Experimental::Browsable::RAnyObjectHolder::fClass {nullptr}
private

! object class

Definition at line 27 of file RAnyObjectHolder.hxx.

◆ fObj

void* ROOT::Experimental::Browsable::RAnyObjectHolder::fObj {nullptr}
private

! plain holder without IO

Definition at line 28 of file RAnyObjectHolder.hxx.

◆ fOwner

bool ROOT::Experimental::Browsable::RAnyObjectHolder::fOwner {false}
private

! is object owner

Definition at line 29 of file RAnyObjectHolder.hxx.

Libraries for ROOT::Experimental::Browsable::RAnyObjectHolder:

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