28 namespace Experimental {
33 class TFileStorageInterface;
34 class TFileSharedPtrCtor;
47 std::unique_ptr<Internal::TFileStorageInterface>
fStorage;
49 TFile(std::unique_ptr<Internal::TFileStorageInterface> &&storage);
55 friend Internal::TFileSharedPtrCtor;
64 bool fAsynchronousOpen =
false;
67 int fAsyncTimeout = 0;
72 bool fCachedRead =
false;
112 static std::string GetCacheDir();
141 return std::make_unique<T>(*Get<T>(
name));
161 auto dep =
Find(name);
162 WriteMemoryWithType(name, dep.GetPointer().get(), dep.GetType());
191 TFilePtr(std::shared_ptr<TFile> &&);
204 operator bool()
const {
return fFile.get(); }
Options_t()
Default constructor needed for member inits.
void Write(std::string_view name, std::shared_ptr< T > &&obj)
Hand over lifetime management of an object to this TFileImplBase, and write it.
std::unique_ptr< Internal::TFileStorageInterface > fStorage
Storage backend.
basic_string_view< char > string_view
Namespace for new ROOT classes and functions.
Options for TFile construction.
std::unique_ptr< T > Read(std::string_view name)
Read the object for a key.
TFile * operator->()
Dereference the file pointer, giving access to the TFileImplBase object.
void Write(std::string_view name, const T *obj)
Write an object that is not lifetime managed by this TFileImplBase.
const TFile * operator->() const
Dereference the file pointer, giving access to the TFileImplBase object.
std::string fCacheDir
Where to cache the file. If empty, defaults to TFilePtr::GetCacheDir().
The ROOT global object gROOT contains a list of all defined classes.
std::shared_ptr< TFile > fFile
void Add(THist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const THist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
Points to an object that stores or reads objects in ROOT's binary format.
void Write(std::string_view name, const T &obj)
Write an object that is not lifetime managed by this TFileImplBase.
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.
UInt_t Find(std::list< std::pair< const Node< T > *, Float_t > > &nlist, const Node< T > *node, const T &event, UInt_t nfind)
Key/value store of objects.
void Write(std::string_view name)
Write an object that is already lifetime managed by this TFileImplBase.