File indexing completed on 2024-04-06 12:11:31
0001 #ifndef Fireworks_Core_FWEnumParameter_h
0002 #define Fireworks_Core_FWEnumParameter_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "Fireworks/Core/interface/FWLongParameter.h"
0025 #include "RtypesCore.h"
0026 #include <map>
0027
0028
0029
0030 class FWEnumParameter : public FWLongParameter {
0031 public:
0032 FWEnumParameter() : FWLongParameter() {}
0033
0034 FWEnumParameter(
0035 FWParameterizable* iParent, const std::string& iName, const long& iDefault = 0, long iMin = -1, long iMax = -1)
0036 : FWLongParameter(iParent, iName, iDefault, iMin, iMax) {}
0037
0038 template <class K>
0039 FWEnumParameter(FWParameterizable* iParent,
0040 const std::string& iName,
0041 K iCallback,
0042 const long& iDefault = 0,
0043 long iMin = -1,
0044 long iMax = -1)
0045 : FWLongParameter(iParent, iName, iCallback, iDefault, iMin, iMax) {}
0046
0047
0048
0049
0050
0051
0052
0053 bool addEntry(Long_t id, const std::string& txt) { return m_enumEntries.insert(std::make_pair(id, txt)).second; }
0054
0055 const std::map<Long_t, std::string>& entryMap() const { return m_enumEntries; }
0056
0057 FWEnumParameter(const FWEnumParameter&) = delete;
0058 const FWEnumParameter& operator=(const FWEnumParameter&) = delete;
0059
0060 private:
0061
0062 std::map<Long_t, std::string> m_enumEntries;
0063 };
0064
0065 #endif