CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: FWEnumParameter.h,v 1.1 2010/04/30 15:29:44 matevz Exp $
20 //
21 
22 // system include files
23 
24 // user include files
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&); // stop default
70  const FWEnumParameter& operator=(const FWEnumParameter&); // 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 &)