Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:38

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     void name(const std::string& aName);
0026 
0027     std::map<size_t, Channel>::const_iterator begin() const;
0028 
0029     std::map<size_t, Channel>::iterator begin();
0030 
0031     std::map<size_t, Channel>::const_iterator end() const;
0032 
0033     std::map<size_t, Channel>::iterator end();
0034 
0035     Channel& add(size_t);
0036 
0037     Channel& add(size_t, const Channel&);
0038 
0039     Channel& at(size_t);
0040 
0041     const Channel& at(size_t) const;
0042 
0043     bool has(size_t) const;
0044 
0045     // Returns number of channels
0046     size_t size();
0047 
0048   private:
0049     std::string name_;
0050 
0051     // Map of channel indices to data
0052     std::map<size_t, Channel> data_;
0053   };
0054 
0055 }  // namespace l1t::demo
0056 
0057 #endif