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:385
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 339 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 344 of file TDirectory.h.

Member Function Documentation

◆ operator bool()

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

Definition at line 355 of file TDirectory.h.

◆ operator T*()

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

Definition at line 347 of file TDirectory.h.

◆ operator TDirectory *()

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

Definition at line 351 of file TDirectory.h.

◆ operator!=() [1/2]

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

Definition at line 361 of file TDirectory.h.

◆ operator!=() [2/2]

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

Definition at line 369 of file TDirectory.h.

◆ operator->()

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

Definition at line 381 of file TDirectory.h.

◆ operator=()

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

Definition at line 373 of file TDirectory.h.

◆ operator==() [1/2]

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

Definition at line 357 of file TDirectory.h.

◆ operator==() [2/2]

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

Definition at line 365 of file TDirectory.h.

Member Data Documentation

◆ fValue

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

Definition at line 342 of file TDirectory.h.

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

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