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