30namespace Experimental {
60static void AddFilesToClose(std::weak_ptr<ROOT::Experimental::RFile> pFile)
63 std::vector<std::weak_ptr<ROOT::Experimental::RFile>> fFiles;
67 for (
auto &
wFile: fFiles) {
76 std::lock_guard<std::mutex> lock(
closer.fMutex);
77 closer.fFiles.emplace_back(pFile);
87 TV6Storage(
const std::string &
name,
const std::string &
mode): fOldFile(::
TFile::Open(
name.c_str(),
mode.c_str())) {}
95 void WriteMemoryWithType(std::string_view
name,
const void *address,
TClass *cl)
final
111 if (
opts.fCachedRead)
112 ret +=
" CACHEREAD ";
113 if (
opts.fAsynchronousOpen &&
opts.fAsyncTimeout > 0)
114 ret +=
" TIMEOUT=" + std::to_string(
opts.fAsyncTimeout) +
" ";
124static std::unique_ptr<ROOT::Experimental::Internal::RFileStorageInterface>
131 std::lock_guard<std::mutex> fLock;
149 return std::unique_ptr<RFileStorageInterface>{std::move(
v6storage)};
157 using namespace Internal;
166 using namespace Internal;
175 using namespace Internal;
184 using namespace Internal;
201 return ::TFile::GetCacheFileDir();
224 fStorage->WriteMemoryWithType(
name, address, cl);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char mode
RFileSharedPtrCtor(std::unique_ptr< RFileStorageInterface > &&storage)
Base class for RFile storage backends.
virtual void WriteMemoryWithType(std::string_view name, const void *address, TClass *cl)=0
virtual ~RFileStorageInterface()=default
Key/value store of objects.
static RDirectory & Heap()
Dedicated, process-wide RDirectory.
Points to an object that stores or reads objects in ROOT's binary format.
std::shared_ptr< RFile > fFile
RFilePtr(std::shared_ptr< RFile > &&)
Constructed by Open etc.
static RFilePtr Recreate(std::string_view name, const Options_t &opts=Options_t())
Open a file with name for reading and writing.
RFile(std::unique_ptr< Internal::RFileStorageInterface > &&storage)
void Flush()
Save all objects associated with this directory (including file header) to the storage medium.
static std::string SetCacheDir(std::string_view path)
Set the new directory used for cached reads, returns the old directory.
static std::string GetCacheDir()
Get the directory used for cached reads.
~RFile()
Must not call Write() of all attached objects: some might not be needed to be written or writing migh...
static RFilePtr Open(std::string_view name, const Options_t &opts=Options_t())
Open a file with name for reading.
static RFilePtr OpenForUpdate(std::string_view name, const Options_t &opts=Options_t())
Open an existing file with name for reading and writing.
void WriteMemoryWithType(std::string_view name, const void *address, TClass *cl)
Serialize the object at address, using the object's TClass.
static RFilePtr Create(std::string_view name, const Options_t &opts=Options_t())
Open a file with name for reading and writing.
void Close()
Flush() and make the file non-writable: close it.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Int_t WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option="", Int_t bufsize=0) override
Write object from pointer of class classname in this directory.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static const char * GetCacheFileDir()
Get the directory where to locally stage/cache remote files.
virtual void Flush()
Synchronize a file's in-memory and on-disk states.
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
void Close(Option_t *option="") override
Close a file.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Options for RFile construction.