12 #ifndef ROOT_TBufferMerger 13 #define ROOT_TBufferMerger 17 #include <condition_variable> 28 namespace Experimental {
30 class TBufferMergerFile;
72 std::shared_ptr<TBufferMergerFile>
GetFile();
109 void Init(std::unique_ptr<TFile>);
167 virtual Int_t Write(
const char *
name =
nullptr,
Int_t opt = 0,
Int_t bufsize = 0)
override;
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.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
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 >)
std::queue< TBufferFile * > fQueue
#define ClassDef(name, id)
TBufferMerger & operator=(const TBufferMerger &)
TBufferMerger has no copy operator.
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)
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
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
TBufferMerger is a class to facilitate writing data in parallel from multiple threads, while writing to a single output file.
std::unique_ptr< std::thread > fMergingThread
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.
#define ClassDefOverride(name, id)