Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:16:30

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef GLOBALVERTEX_SVTXVERTEXMAP_H
0004 #define GLOBALVERTEX_SVTXVERTEXMAP_H
0005 
0006 #include "SvtxVertex.h"
0007 
0008 #include <phool/PHObject.h>
0009 
0010 #include <cstddef>
0011 #include <iostream>
0012 #include <map>
0013 
0014 class SvtxVertexMap : public PHObject
0015 {
0016  public:
0017   typedef std::map<unsigned int, SvtxVertex*> VertexMap;
0018   typedef std::map<unsigned int, SvtxVertex*>::const_iterator ConstIter;
0019   typedef std::map<unsigned int, SvtxVertex*>::iterator Iter;
0020 
0021   ~SvtxVertexMap() override {}
0022 
0023   void identify(std::ostream& os = std::cout) const override
0024   {
0025     os << "SvtxVertexMap base class" << std::endl;
0026   }
0027   int isValid() const override { return 0; }
0028   PHObject* CloneMe() const override { return nullptr; }
0029 
0030   virtual bool empty() const { return true; }
0031   virtual size_t size() const { return 0; }
0032   virtual size_t count(unsigned int /*idkey*/) const { return 0; }
0033   virtual void clear() {}
0034 
0035   virtual const SvtxVertex* get(unsigned int /*idkey*/) const { return nullptr; }
0036   virtual SvtxVertex* get(unsigned int /*idkey*/) { return nullptr; }
0037 
0038   //! Add vertex to container. Note the container take to ownership
0039   virtual SvtxVertex* insert(SvtxVertex* /*cluster*/) { return nullptr; }
0040   //! legacy interface. Add vertex to container. Note the container does not take ownership
0041   virtual SvtxVertex* insert_clone(const SvtxVertex* /*vertex*/) { return nullptr; }
0042 
0043   virtual size_t erase(unsigned int /*idkey*/) { return 0; }
0044 
0045   virtual ConstIter begin() const;
0046   virtual ConstIter find(unsigned int idkey) const;
0047   virtual ConstIter end() const;
0048 
0049   virtual Iter begin();
0050   virtual Iter find(unsigned int idkey);
0051   virtual Iter end();
0052 
0053  protected:
0054   SvtxVertexMap() {}
0055 
0056  private:
0057   ClassDefOverride(SvtxVertexMap, 1);
0058 };
0059 
0060 #endif