5#ifndef ROOT_RHistConcurrentFiller
6#define ROOT_RHistConcurrentFiller
20namespace Experimental {
38template <
typename BinContentType>
41 std::shared_ptr<RHist<BinContentType>>
fHist;
46 std::vector<std::weak_ptr<RHistFillContext<BinContentType>>>
fFillContexts;
55 throw std::invalid_argument(
"hist must not be nullptr");
67 if (!context.expired()) {
75 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.
std::shared_ptr< RHist< BinContentType > > fHist
A pointer to the filled histogram.
RHistConcurrentFiller(const RHistConcurrentFiller< BinContentType > &)=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< BinContentType > & operator=(const RHistConcurrentFiller< BinContentType > &)=delete
std::shared_ptr< RHistFillContext< BinContentType > > CreateFillContext()
Create a new context for concurrent filling.
const std::shared_ptr< RHist< BinContentType > > & GetHist() const
RHistConcurrentFiller(RHistConcurrentFiller< BinContentType > &&)=delete
RHistConcurrentFiller< BinContentType > & operator=(RHistConcurrentFiller< BinContentType > &&)=delete