Skip to content
Snippets Groups Projects

Use event-local memory pool when reading RawEvent

Merged Olli Lupton requested to merge olupton_pool_daq into master
Files
10
+ 5
7
@@ -24,19 +24,17 @@ namespace LHCb::MDF {
/**
* This class represents a single event in the event buffer
* Upon creation, it only gets a raw buffer and a size.
* Banks are then decoded from the buffer and added to the m_event when
* Banks are then decoded from the buffer and added to a RawEvent when
* calling get on the Buffer object
*/
class MDFEvent {
public:
MDFEvent() = default;
MDFEvent( LHCb::span<std::byte> data ) : m_data( data ) {}
LHCb::RawEvent& event() { return m_event; }
std::byte* data() { return m_data.data(); }
unsigned int size() { return m_data.size(); }
std::byte* data() { return m_data.data(); }
unsigned int size() { return m_data.size(); }
private:
LHCb::RawEvent m_event;
LHCb::span<std::byte> m_data;
};
@@ -57,10 +55,10 @@ namespace LHCb::MDF {
static void setReservedNumberOfBanks( unsigned int nbBanksReserve ) { s_nbBanksReserve = nbBanksReserve; }
/**
* get the next event in the Buffer. This method is thread safe
* and garantees to return evry single event exactly once
* and guarantees to return every single event exactly once
* @returns the event or nothing when the buffer is empty
*/
std::optional<LHCb::RawEvent> get();
std::optional<LHCb::RawEvent> get( EventContext const& evtCtx );
private:
/// vector of RawEvents, pointing to the Rawbanks in rawBuffer
Loading