5#ifndef ROOT_RHistConcurrentFiller
6#define ROOT_RHistConcurrentFiller
18namespace Experimental {
36template <
typename BinContentType>
39 std::shared_ptr<RHist<BinContentType>>
fHist;
44 std::vector<std::weak_ptr<RHistFillContext<BinContentType>>>
fFillContexts;
53 throw std::invalid_argument(
"hist must not be nullptr");
65 if (!context.expired()) {
73 const std::shared_ptr<RHist<BinContentType>> &
GetHist()
const {
return fHist; }
A histogram filler to concurrently fill an RHist.
RHistConcurrentFiller(std::shared_ptr< RHist< BinContentType > > hist)
Create a filler object.
RHistConcurrentFiller & operator=(const RHistConcurrentFiller &)=delete
std::shared_ptr< RHist< BinContentType > > fHist
A pointer to the filled histogram.
RHistConcurrentFiller(const RHistConcurrentFiller &)=delete
std::mutex fMutex
Mutex to protect access to the list of fill contexts (not for filling itself!)
std::vector< std::weak_ptr< RHistFillContext< BinContentType > > > fFillContexts
The list of fill contexts, for checks during destruction.
RHistConcurrentFiller(RHistConcurrentFiller &&)=delete
std::shared_ptr< RHistFillContext< BinContentType > > CreateFillContext()
Create a new context for concurrent filling.
const std::shared_ptr< RHist< BinContentType > > & GetHist() const
RHistConcurrentFiller & operator=(RHistConcurrentFiller &&)=delete