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 "RtypesCore.h"
26 #include <map>
27 
28 // forward declarations
29 
31 {
32 
33  public:
35  {}
36 
38  const std::string& iName,
39  const long &iDefault=0,
40  long iMin=-1,
41  long iMax=-1) :
42  FWLongParameter(iParent, iName, iDefault, iMin, iMax)
43  {}
44 
45  template <class K>
47  const std::string& iName,
48  K iCallback,
49  const long &iDefault=0,
50  long iMin=-1,
51  long iMax=-1) :
52  FWLongParameter(iParent, iName, iCallback, iDefault, iMin, iMax)
53  {}
54 
55  // ---------- const member functions ---------------------
56 
57  // ---------- static member functions --------------------
58 
59  // ---------- member functions ---------------------------
60 
61  bool addEntry(Long_t id, const std::string& txt)
62  {
63  return m_enumEntries.insert(std::make_pair(id, txt)).second;
64  }
65 
66  const std::map<Long_t, std::string>& entryMap() const { return m_enumEntries; }
67 
68 private:
69  FWEnumParameter(const FWEnumParameter&) = delete; // stop default
70  const FWEnumParameter& operator=(const FWEnumParameter&) = delete; // stop default
71 
72  // ---------- member data --------------------------------
73  std::map<Long_t, std::string> m_enumEntries;
74 };
75 
76 #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