CbmRoot
Loading...
Searching...
No Matches
CbmTbDaqBuffer.h
Go to the documentation of this file.
1/* Copyright (C) 2012-2020 PI-UHd, GSI
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese, Norbert Herrmann [committer] */
4
10#ifndef CBMTBDAQBUFFER_H
11#define CBMTBDAQBUFFER_H 1
12
13#include "CbmDefs.h"
14
15#include <RtypesCore.h> // for Double_t, Int_t
16
17#include <boost/any.hpp>
18
19#include <map> // for multimap, __map_const_iterator, multimap<>::...
20#include <utility> // for pair
21
40public:
41 typedef std::pair<boost::any, ECbmModuleId> Data;
42
45
54 // boost::any GetNextData(Double_t time);
55 Data GetNextData(Double_t time);
56
57
61 Int_t GetSize() const { return fData.size(); }
62
63
65 Double_t GetTimeFirst() const;
66
68 Double_t GetTimeLast() const;
69
73 static CbmTbDaqBuffer* Instance();
74
76 void PrintStatus() const;
77
79 template<class Digi>
80 void InsertData(Digi* digi)
81 {
82 Double_t digi_time = digi->GetTime();
83 ECbmModuleId systemID = Digi::GetSystem();
84 InsertData(digi, digi_time, systemID);
85 }
86
87private:
89 std::multimap<Double_t, Data> fData;
90
91
94
95
100
101
104
105
108
112 // void InsertData(boost::any digi);
113 void InsertData(boost::any digi, Double_t time, ECbmModuleId systemID)
114 {
115 fData.insert(std::make_pair(time, std::make_pair(std::move(digi), systemID)));
116 }
117};
118
119
120#endif /* CBMTBDAQBUFFER_H */
ECbmModuleId
Definition CbmDefs.h:39
Singleton buffer class for CBM raw data.
Double_t GetTimeLast() const
Data GetNextData(Double_t time)
std::multimap< Double_t, Data > fData
static CbmTbDaqBuffer * Instance()
Int_t GetSize() const
CbmTbDaqBuffer & operator=(const CbmTbDaqBuffer &)
CbmTbDaqBuffer(const CbmTbDaqBuffer &)
std::pair< boost::any, ECbmModuleId > Data
void PrintStatus() const
Double_t GetTimeFirst() const
void InsertData(Digi *digi)
static CbmTbDaqBuffer * fgInstance
void InsertData(boost::any digi, Double_t time, ECbmModuleId systemID)