Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MbdVertexMapv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MbdVertexMapv1.h
1 #ifndef G4MBD_MBDVERTEXMAPV1_H
2 #define G4MBD_MBDVERTEXMAPV1_H
3 
4 #include "MbdVertexMap.h"
5 
6 #include "MbdVertex.h"
7 
8 #include <cstddef> // for size_t
9 #include <iostream>
10 #include <map>
11 
13 {
14  public:
16  ~MbdVertexMapv1() 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 MbdVertex* get(unsigned int idkey) const override;
28  MbdVertex* get(unsigned int idkey) override;
29  MbdVertex* insert(MbdVertex* 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, MbdVertex*> _map;
46 
48 };
49 
50 #endif // G4MBD_MBDVERTEXMAPV1_H