8#include <boost/dynamic_bitset.hpp>
17using SysPoint = std::chrono::time_point<SysClock>;
32template<
typename IntType = u
int8_t>
35 typedef map<SysPoint, IntType> TimeLine;
36 typedef map<SysPoint, size_t> Time2Pos;
37 typedef map<string, TimeLine> Scaler2TimeDist;
39 typedef std::map<uint8_t, TimeLine> ScalerIdx2TimeDist;
45 : fNRecords{times_count}
49 , fScalerName2index{scalerName2Index}
52 , fBitVecSpill(fNRecords, false)
53 , fBitVecBusy(fNRecords, false)
77 auto it = fScalerName2index.find(scaler_name);
78 if (it == fScalerName2index.end()) {
79 throw out_of_range(
"Scaler not found");
113 auto it = fScalerName2index.find(scaler_name);
114 if (it == fScalerName2index.end()) {
115 throw out_of_range(
"Scaler name not found");
121 if (scaler_id >= fScalerName2index.size())
122 throw out_of_range(
"Scaler index not found");
123 return fMapVector[scaler_id];
127 auto it = row.find(time);
145 const size_t fNRecords;
148 vector<TimeLine> fMapVector;
154 vector<SysPoint> fTimes;
157 boost::dynamic_bitset<> fBitVecSpill;
158 boost::dynamic_bitset<> fBitVecBusy;
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
std::chrono::system_clock SysClock
std::chrono::time_point< SysClock > SysPoint
std::unordered_map< std::string, uint16_t > NameChMap
static SysPoint TimeStamp2TP(TTimeStamp p)
static TTimeStamp TimePoint2TS(SysPoint p)
static IntType GetCntByTime(TimeLine &row, SysPoint &time)
BmnMSCMatrix(size_t times_count=0, NameChMap scalerName2Index=NameChMap{})
TimeLine & ScalerTimeLine(uint16_t scaler_id)
SysPoint & Time(size_t record_id)
IntType GetCount(size_t record_id, uint16_t scaler_id)
const size_t GetNRecords()
NameChMap & GetScalerName2indexMap()
void SetCount(size_t record_id, string scaler_name, IntType val)
TTimeStamp GetTS(size_t record_id)
void SetCount(size_t record_id, uint16_t scaler_id, IntType val)
void SetTS(size_t record_id, TTimeStamp ts)
const uint16_t GetNScalers()
TimeLine & ScalerTimeLine(string scaler_name)
IntType GetCount(SysPoint &time, string scaler_name)
IntType GetCount(SysPoint &time, uint16_t scaler_id)
IntType GetCount(size_t record_id, string scaler_name)
std::chrono::time_point< SysClock > SysPoint