Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:40

0001 #ifndef INTT_INTTVERTEXMAPV1_H
0002 #define INTT_INTTVERTEXMAPV1_H
0003 
0004 #include "InttVertex.h"
0005 #include "InttVertexMap.h"
0006 
0007 #include <cstddef>  // for size_t
0008 #include <iostream>
0009 #include <map>
0010 
0011 class InttVertexMapv1 : public InttVertexMap
0012 {
0013  public:
0014   InttVertexMapv1() = default;
0015   ~InttVertexMapv1() override;
0016 
0017   void identify(std::ostream& os = std::cout) const override;
0018   void Reset() override { clear(); }
0019   int isValid() const override { return 1; }
0020 
0021   bool empty() const override { return _map.empty(); }
0022   size_t size() const override { return _map.size(); }
0023   size_t count(unsigned int idkey) const override { return _map.count(idkey); }
0024   void clear() override;
0025 
0026   const InttVertex* get(unsigned int idkey) const override;
0027   InttVertex* get(unsigned int idkey) override;
0028   InttVertex* insert(InttVertex* vertex) override;
0029   size_t erase(unsigned int idkey) override
0030   {
0031     delete _map[idkey];
0032     return _map.erase(idkey);
0033   }
0034 
0035   ConstIter begin() const override { return _map.begin(); }
0036   ConstIter find(unsigned int idkey) const override { return _map.find(idkey); }
0037   ConstIter end() const override { return _map.end(); }
0038 
0039   Iter begin() override { return _map.begin(); }
0040   Iter find(unsigned int idkey) override { return _map.find(idkey); }
0041   Iter end() override { return _map.end(); }
0042 
0043  private:
0044   std::map<unsigned int, InttVertex*> _map;
0045 
0046   ClassDefOverride(InttVertexMapv1, 1);
0047 };
0048 
0049 #endif  // INTT_INTTVERTEXMAPV1_H