File indexing completed on 2021-02-14 13:14:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef EventFilter_CTPPSRawToDigi_SimpleVFATFrameCollection
0011 #define EventFilter_CTPPSRawToDigi_SimpleVFATFrameCollection
0012
0013 #include "EventFilter/CTPPSRawToDigi/interface/VFATFrameCollection.h"
0014
0015 #include <map>
0016
0017
0018
0019
0020 class SimpleVFATFrameCollection : public VFATFrameCollection {
0021 protected:
0022 typedef std::map<TotemFramePosition, VFATFrame> MapType;
0023
0024 MapType data;
0025
0026 value_type BeginIterator() const override;
0027 value_type NextIterator(const value_type&) const override;
0028 bool IsEndIterator(const value_type&) const override;
0029
0030 public:
0031 SimpleVFATFrameCollection();
0032 ~SimpleVFATFrameCollection() override;
0033
0034 const VFATFrame* GetFrameByID(unsigned int ID) const override;
0035 const VFATFrame* GetFrameByIndex(TotemFramePosition index) const override;
0036
0037 unsigned int Size() const override { return data.size(); }
0038
0039 bool Empty() const override { return (data.empty()); }
0040
0041 void Insert(const TotemFramePosition& index, const VFATFrame& frame) { data.insert({index, frame}); }
0042
0043
0044 VFATFrame* InsertEmptyFrame(TotemFramePosition index) { return &data.insert({index, VFATFrame()}).first->second; }
0045
0046
0047 void Clear() { data.clear(); }
0048 };
0049
0050 #endif