Analysis Software
Documentation for sPHENIX simulation 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 // cppcheck-suppress virtualCallInConstructor
23  void Reset() override;
24  int isValid() const override { return 1; }
25  PHObject* CloneMe() const override { return new SvtxVertexMap_v1(*this); }
26 
27  bool empty() const override { return _map.empty(); }
28  size_t size() const override { return _map.size(); }
29  size_t count(unsigned int idkey) const override { return _map.count(idkey); }
30  void clear() override { Reset(); }
31 
32  const SvtxVertex* get(unsigned int idkey) const override;
33  SvtxVertex* get(unsigned int idkey) override;
34 
36  SvtxVertex* insert(SvtxVertex* vertex) override;
38  SvtxVertex* insert_clone(const SvtxVertex* vertex) override;
39  size_t erase(unsigned int idkey) override
40  {
41  delete _map[idkey];
42  return _map.erase(idkey);
43  }
44 
45  ConstIter begin() const override { return _map.begin(); }
46  ConstIter find(unsigned int idkey) const override { return _map.find(idkey); }
47  ConstIter end() const override { return _map.end(); }
48 
49  Iter begin() override { return _map.begin(); }
50  Iter find(unsigned int idkey) override { return _map.find(idkey); }
51  Iter end() override { return _map.end(); }
52 
53  private:
54  std::map<unsigned int, SvtxVertex*> _map;
55 
57 };
58 
59 #endif // __SVTXVERTEXMAP_V1_H__