EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BbcVertexMapv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BbcVertexMapv1.h
1 #ifndef G4BBC_BBCVERTEXMAPV1_H
2 #define G4BBC_BBCVERTEXMAPV1_H
3 
4 #include "BbcVertexMap.h"
5 
6 #include "BbcVertex.h"
7 
8 #include <cstddef> // for size_t
9 #include <iostream>
10 #include <map>
11 
13 {
14  public:
16  ~BbcVertexMapv1() override;
17 
18  void identify(std::ostream& os = std::cout) const override;
19  void Reset() override { clear(); }
20  int isValid() const override { return 1; }
21 
22  bool empty() const override { return _map.empty(); }
23  size_t size() const override { return _map.size(); }
24  size_t count(unsigned int idkey) const override { return _map.count(idkey); }
25  void clear() override;
26 
27  const BbcVertex* get(unsigned int idkey) const override;
28  BbcVertex* get(unsigned int idkey) override;
29  BbcVertex* insert(BbcVertex* vertex) override;
30  size_t erase(unsigned int idkey) override
31  {
32  delete _map[idkey];
33  return _map.erase(idkey);
34  }
35 
36  ConstIter begin() const override { return _map.begin(); }
37  ConstIter find(unsigned int idkey) const override { return _map.find(idkey); }
38  ConstIter end() const override { return _map.end(); }
39 
40  Iter begin() override { return _map.begin(); }
41  Iter find(unsigned int idkey) override { return _map.find(idkey); }
42  Iter end() override { return _map.end(); }
43 
44  private:
45  std::map<unsigned int, BbcVertex*> _map;
46 
48 };
49 
50 #endif // G4BBC_BBCVERTEXMAPV1_H