Class Reference for E1039 Core & Analysis Software
SQIntMap.h
Go to the documentation of this file.
1 /*
2  * SQIntMap.h
3  */
4 #ifndef _H_SQIntMap_H_
5 #define _H_SQIntMap_H_
6 
7 #include <phool/PHObject.h>
8 #include <map>
9 #include <iostream>
10 
12 
14 class SQIntMap : public PHObject {
15 public:
16  typedef std::map<unsigned int, PHObject*> ObjectMap;
17  typedef ObjectMap::const_iterator ConstIter;
18  typedef ObjectMap::iterator Iter;
19 
20  virtual ~SQIntMap() {}
21 
22  virtual void identify(std::ostream& os = std::cout) const {
23  os << "SQIntMap base class" << std::endl;
24  }
25  virtual void Reset() {}
26  virtual int isValid() const {return 0;}
27  virtual SQIntMap* Clone() const {return NULL;}
28 
29  virtual bool empty() const {return true;}
30  virtual size_t size() const {return 0;}
31  virtual size_t count(unsigned int idkey) const {return 0;}
32  virtual void clear() {}
33 
34  virtual const PHObject* get(unsigned int idkey) const {return NULL;}
35  virtual PHObject* get(unsigned int idkey) {return NULL;}
36  virtual PHObject* insert(const unsigned int idkey, const PHObject *item) {return NULL;}
37  virtual size_t erase(unsigned int idkey) {return 0;}
38 
39  virtual ConstIter begin() const {return ObjectMap().end();}
40  virtual ConstIter find(unsigned int idkey) const {return ObjectMap().end();}
41  virtual ConstIter end() const {return ObjectMap().end();}
42 
43  virtual Iter begin() {return ObjectMap().end();}
44  virtual Iter find(unsigned int idkey) {return ObjectMap().end();}
45  virtual Iter end() {return ObjectMap().end();}
46 
47 protected:
48  SQIntMap() {}
49 
50 private:
51  ClassDef(SQIntMap, 1);
52 };
53 
54 #endif /* _H_SQIntMap_H_ */
#define NULL
Definition: Pdb.h:9
A general-purpose SQ interface class that holds a list of PHObjects with key = integer.
Definition: SQIntMap.h:14
virtual const PHObject * get(unsigned int idkey) const
Definition: SQIntMap.h:34
virtual int isValid() const
isValid returns non zero if object contains vailid data
Definition: SQIntMap.h:26
virtual size_t size() const
Definition: SQIntMap.h:30
virtual ConstIter begin() const
Definition: SQIntMap.h:39
virtual SQIntMap * Clone() const
Definition: SQIntMap.h:27
SQIntMap()
Definition: SQIntMap.h:48
virtual void clear()
Definition: SQIntMap.h:32
virtual size_t erase(unsigned int idkey)
Definition: SQIntMap.h:37
virtual Iter end()
Definition: SQIntMap.h:45
virtual PHObject * insert(const unsigned int idkey, const PHObject *item)
Definition: SQIntMap.h:36
virtual PHObject * get(unsigned int idkey)
Definition: SQIntMap.h:35
virtual Iter begin()
Definition: SQIntMap.h:43
ObjectMap::iterator Iter
Definition: SQIntMap.h:18
virtual ~SQIntMap()
Definition: SQIntMap.h:20
virtual Iter find(unsigned int idkey)
Definition: SQIntMap.h:44
virtual void Reset()
Clear Event.
Definition: SQIntMap.h:25
virtual ConstIter end() const
Definition: SQIntMap.h:41
virtual void identify(std::ostream &os=std::cout) const
Definition: SQIntMap.h:22
virtual size_t count(unsigned int idkey) const
Definition: SQIntMap.h:31
virtual ConstIter find(unsigned int idkey) const
Definition: SQIntMap.h:40
virtual bool empty() const
Definition: SQIntMap.h:29
std::map< unsigned int, PHObject * > ObjectMap
Definition: SQIntMap.h:16
ObjectMap::const_iterator ConstIter
Definition: SQIntMap.h:17