00001 #ifndef _ots_AssociativeMemoryEventBuilder_h 00002 #define _ots_AssociativeMemoryEventBuilder_h 00003 00004 #include "otsdaq-core/EventBuilder/VirtualEventBuilder.h" 00005 #include "otsdaq-core/DataDecoders/DataDecoder.h" 00006 #include <queue> 00007 #include <string> 00008 #include <stdint.h> 00009 00010 namespace ots 00011 { 00012 00013 class Event; 00014 00015 class AssociativeMemoryEventBuilder : public VirtualEventBuilder 00016 { 00017 public: 00018 AssociativeMemoryEventBuilder(std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID, ConsumerPriority priority); 00019 virtual ~AssociativeMemoryEventBuilder(void); 00020 00021 void build(const std::string& buffer); 00022 std::queue<Event*>& getCompleteEvents(void); 00023 std::queue<Event*>& getAllEvents(void); 00024 00025 private: 00026 std::queue<Event*>& getCompleteEvents(unsigned int bcoDifference); 00027 std::map<uint64_t,Event*> memory_; 00028 bool bcoIsComplete_; 00029 uint64_t currentBCO_; 00030 std::queue<uint32_t> convertedBuffer_; 00031 DataDecoder theDataDecoder_; 00032 00033 00034 }; 00035 00036 } 00037 00038 #endif