Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-01 23:54:03

0001 
0002 #ifndef L1Trigger_DemonstratorTools_BoardData_h
0003 #define L1Trigger_DemonstratorTools_BoardData_h
0004 
0005 #include <map>
0006 #include <vector>
0007 
0008 #include "L1Trigger/DemonstratorTools/interface/Frame.h"
0009 
0010 namespace l1t::demo {
0011 
0012   //! Class representing information that's stored in the input or output buffers on a phase-2 board
0013   class BoardData {
0014   public:
0015     typedef std::vector<Frame> Channel;
0016 
0017     BoardData();
0018 
0019     BoardData(const std::string& name);
0020 
0021     BoardData(const std::string& name, const std::vector<size_t>& channels, size_t length);
0022 
0023     const std::string& name() const;
0024 
0025     std::map<size_t, Channel>::const_iterator begin() const;
0026 
0027     std::map<size_t, Channel>::iterator begin();
0028 
0029     std::map<size_t, Channel>::const_iterator end() const;
0030 
0031     std::map<size_t, Channel>::iterator end();
0032 
0033     Channel& add(size_t);
0034 
0035     Channel& add(size_t, const Channel&);
0036 
0037     Channel& at(size_t);
0038 
0039     const Channel& at(size_t) const;
0040 
0041     bool has(size_t) const;
0042 
0043     // Returns number of channels
0044     size_t size();
0045 
0046   private:
0047     std::string name_;
0048 
0049     // Map of channel indices to data
0050     std::map<size_t, Channel> data_;
0051   };
0052 
0053 }  // namespace l1t::demo
0054 
0055 #endif