Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Internal::TDirectoryAtomicAdapter Struct Reference

Internal class used in the implementation of gDirectory The objects of type TDirectoryAtomicAdapter should only be used inside the thread that created them.

The intent is for those objects to be used indirectly through the macro gDirectory and solely as temporary objects. For example:

gDirectory = newvalue;
gDirectory->ls();
#define gDirectory
Definition TDirectory.h:384
Describe directory structure in memory.
Definition TDirectory.h:45

Note that:

auto dir = gDirectory;

currently behaves "unexpectedly" as changing dir will also change gDirectory:

dir = newvalue;

leads to

gDirectory == newvalue

To prevent this we would need a new mechanism such that the type used by auto in that case is TDirectory* rather than the Internal type TDirectoryAtomicAdapter.

Definition at line 338 of file TDirectory.h.

Public Member Functions

 TDirectoryAtomicAdapter ()
 
 operator bool () const
 
template<typename T >
 operator T* () const
 
 operator TDirectory * () const
 
bool operator!= (const TDirectory *other) const
 
bool operator!= (TDirectory *other) const
 
TDirectoryoperator-> () const
 
TDirectoryoperator= (TDirectory *newvalue)
 
bool operator== (const TDirectory *other) const
 
bool operator== (TDirectory *other) const
 

Public Attributes

TDirectory::SharedGDirectory_tfValue
 

#include <TDirectory.h>

Constructor & Destructor Documentation

◆ TDirectoryAtomicAdapter()

ROOT::Internal::TDirectoryAtomicAdapter::TDirectoryAtomicAdapter ( )
inline

Definition at line 343 of file TDirectory.h.

Member Function Documentation

◆ operator bool()

ROOT::Internal::TDirectoryAtomicAdapter::operator bool ( ) const
inline

Definition at line 354 of file TDirectory.h.

◆ operator T*()

template<typename T >
ROOT::Internal::TDirectoryAtomicAdapter::operator T* ( ) const
inlineexplicit

Definition at line 346 of file TDirectory.h.

◆ operator TDirectory *()

ROOT::Internal::TDirectoryAtomicAdapter::operator TDirectory * ( ) const
inline

Definition at line 350 of file TDirectory.h.

◆ operator!=() [1/2]

bool ROOT::Internal::TDirectoryAtomicAdapter::operator!= ( const TDirectory other) const
inline

Definition at line 360 of file TDirectory.h.

◆ operator!=() [2/2]

bool ROOT::Internal::TDirectoryAtomicAdapter::operator!= ( TDirectory other) const
inline

Definition at line 368 of file TDirectory.h.

◆ operator->()

TDirectory * ROOT::Internal::TDirectoryAtomicAdapter::operator-> ( ) const
inline

Definition at line 380 of file TDirectory.h.

◆ operator=()

TDirectory * ROOT::Internal::TDirectoryAtomicAdapter::operator= ( TDirectory newvalue)
inline

Definition at line 372 of file TDirectory.h.

◆ operator==() [1/2]

bool ROOT::Internal::TDirectoryAtomicAdapter::operator== ( const TDirectory other) const
inline

Definition at line 356 of file TDirectory.h.

◆ operator==() [2/2]

bool ROOT::Internal::TDirectoryAtomicAdapter::operator== ( TDirectory other) const
inline

Definition at line 364 of file TDirectory.h.

Member Data Documentation

◆ fValue

TDirectory::SharedGDirectory_t& ROOT::Internal::TDirectoryAtomicAdapter::fValue

Definition at line 341 of file TDirectory.h.

Collaboration diagram for ROOT::Internal::TDirectoryAtomicAdapter:
[legend]

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