22 namespace Experimental {
29 Init(std::unique_ptr<TFile>(
TFile::Open(name, option, name, compress)));
34 Init(std::move(output));
40 Error(
"TBufferMerger",
"cannot write to output file");
49 if (!
f.expired())
Fatal(
"TBufferMerger",
" TBufferMergerFiles must be destroyed before the server");
59 gROOT->GetListOfFiles()->Remove(f.get());
105 std::unique_ptr<TBufferFile> buffer;
111 buffer.reset(
fQueue.front());
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
std::vector< std::weak_ptr< TBufferMergerFile > > fAttachedFiles
Namespace for new ROOT classes and functions.
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TVirtualMutex * gROOTMutex
size_t GetAutoSave() const
Returns the current value of the auto save setting in bytes (default = 0).
void Push(TBufferFile *buffer)
A TMemFile is like a normal TFile except that it reads and writes only from memory.
void Init(std::unique_ptr< TFile >)
const char * GetOutputFileName() const
std::queue< TBufferFile * > fQueue
void SetAutoSave(size_t size)
By default, TBufferMerger will call TFileMerger::PartialMerge() for each buffer pushed onto its merge...
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
virtual Bool_t AddAdoptFile(TFile *source, Bool_t cpProgress=kTRUE)
Add the TFile to this file merger and give ownership of the TFile to this object (unless kFALSE is re...
virtual Bool_t OutputFile(const char *url, Bool_t force)
Open merger output file.
R__ALWAYS_INLINE Bool_t IsZombie() const
size_t GetQueueSize() const
Returns the number of buffers currently in the queue.
void RegisterCallback(const std::function< void(void)> &f)
Register a user callback function to be called after a buffer has been removed from the merging queue...
virtual ~TBufferMerger()
Destructor.
std::condition_variable fDataAvailable
static TFilePtr Open(std::string_view name, const Options_t &opts=Options_t())
Open a file with name for reading.
std::unique_ptr< std::thread > fMergingThread
#define R__LOCKGUARD(mutex)
TBufferMerger()
TBufferMerger has no default constructor.
friend class TBufferMergerFile
std::function< void(void)> fCallback
std::shared_ptr< TBufferMergerFile > GetFile()
Returns a TBufferMergerFile to which data can be written.
virtual Bool_t PartialMerge(Int_t type=kAll|kIncremental)
Merge the files.
Bool_t IsWritable() const
virtual void Reset()
Reset merger file list.
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.