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