CMS 3D CMS Logo

FWEnumParameter.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWEnumParameter_h
2 #define Fireworks_Core_FWEnumParameter_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWEnumParameter
7 //
16 //
17 // Original Author: matevz
18 // Created: Fri Apr 30 15:16:55 CEST 2010
19 //
20 
21 // system include files
22 
23 // user include files
25 #include <map>
26 
27 // forward declarations
28 
30 {
31 
32  public:
34  {}
35 
37  const std::string& iName,
38  const long &iDefault=0,
39  long iMin=-1,
40  long iMax=-1) :
41  FWLongParameter(iParent, iName, iDefault, iMin, iMax)
42  {}
43 
44  template <class K>
46  const std::string& iName,
47  K iCallback,
48  const long &iDefault=0,
49  long iMin=-1,
50  long iMax=-1) :
51  FWLongParameter(iParent, iName, iCallback, iDefault, iMin, iMax)
52  {}
53 
54  // ---------- const member functions ---------------------
55 
56  // ---------- static member functions --------------------
57 
58  // ---------- member functions ---------------------------
59 
60  bool addEntry(Long_t id, const std::string& txt)
61  {
62  return m_enumEntries.insert(std::make_pair(id, txt)).second;
63  }
64 
65  const std::map<Long_t, std::string>& entryMap() const { return m_enumEntries; }
66 
67 private:
68  FWEnumParameter(const FWEnumParameter&) = delete; // stop default
69  const FWEnumParameter& operator=(const FWEnumParameter&) = delete; // stop default
70 
71  // ---------- member data --------------------------------
72  std::map<Long_t, std::string> m_enumEntries;
73 };
74 
75 #endif
const std::map< Long_t, std::string > & entryMap() const
FWEnumParameter(FWParameterizable *iParent, const std::string &iName, const long &iDefault=0, long iMin=-1, long iMax=-1)
bool addEntry(Long_t id, const std::string &txt)
FWEnumParameter(FWParameterizable *iParent, const std::string &iName, K iCallback, const long &iDefault=0, long iMin=-1, long iMax=-1)
std::map< Long_t, std::string > m_enumEntries
const FWEnumParameter & operator=(const FWEnumParameter &)=delete