86 TMemFile(
const char *
name, std::unique_ptr<TBufferFile> buffer);
void tobuf(char *&buf, Bool_t x)
#define ClassDef(name, id)
Buffer base class used for serializing objects.
A ROOT file is structured in Directories (like a file system).
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
A TMemFile is like a normal TFile except that it reads and writes only from memory.
const ExternalDataPtr_t fExternalData
shared file data / content
bool NeedsExistingFile(EMode mode) const
TMemFile & operator=(const TMemFile &)
Long64_t fDefaultBlockSize
Int_t SysRead(Int_t fd, void *buf, Int_t len)
Read specified number of bytes from current offset into the buffer.
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Perform a stat on the file; see TFile::SysStat().
Int_t SysClose(Int_t fd)
Close the mem file.
Long64_t fBlockOffset
Seek offset within the block.
EMode ParseOption(Option_t *option)
Parse option strings and set fOption.
TMemBlock * fBlockSeek
Pointer to the block we seeked to.
static constexpr Long64_t fgDefaultBlockSize
Long64_t fSize
Total file size (sum of the size of the chunks)
TMemBlock fBlockList
Collection of memory blocks of size fgDefaultBlockSize.
Long64_t MemRead(Int_t fd, void *buf, Long64_t len) const
std::shared_ptr< const std::vector< char > > ExternalDataPtr_t
Long64_t fSysOffset
Seek offset in file.
bool NeedsToWrite(EMode mode) const
Int_t SysSync(Int_t fd)
Sync remaining data to disk.
Int_t SysWriteImpl(Int_t fd, const void *buf, Long64_t len)
Write a buffer into the file.
Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
Write a buffer into the file.
virtual void Print(Option_t *option="") const
Print all objects in the file.
void ResetErrno() const
Simply calls TSystem::ResetErrno().
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
Open a file in 'MemFile'.
virtual Long64_t GetSize() const
Return the current size of the memory file.
void ResetObjects(TDirectoryFile *, TFileMergeInfo *) const
Wipe all the data from the permanent buffer but keep, the in-memory object alive.
void ResetAfterMerge(TFileMergeInfo *)
Wipe all the data from the permanent buffer but keep, the in-memory object alive.
virtual ~TMemFile()
Close and clean-up file.
Int_t SysReadImpl(Int_t fd, void *buf, Long64_t len)
Read specified number of bytes from current offset into the buffer.
virtual Long64_t CopyTo(void *to, Long64_t maxsize) const
Copy the binary representation of the TMemFile into the memory area starting at 'to' and of length at...
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Seek to a specified position in the file.
TMemFile(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Long64_t defBlockSize=0LL)
Usual Constructor.
@ kUseGeneralPurpose
Use the recommended general-purpose setting; moderate read / write speed and compression ratio.
~TMemBlock()
Usual destructors. Delete the block memory.
TMemBlock(const TMemBlock &)
void CreateNext(Long64_t size)
TMemBlock()
Default constructor.
TMemBlock & operator=(const TMemBlock &)