CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/Fireworks/Core/interface/FWEnumParameter.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_FWEnumParameter_h
00002 #define Fireworks_Core_FWEnumParameter_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Core
00006 // Class  :     FWEnumParameter
00007 // 
00016 //
00017 // Original Author:  matevz
00018 //         Created:  Fri Apr 30 15:16:55 CEST 2010
00019 // $Id: FWEnumParameter.h,v 1.1 2010/04/30 15:29:44 matevz Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 #include "Fireworks/Core/interface/FWLongParameter.h"
00026 #include <map>
00027 
00028 // forward declarations
00029 
00030 class FWEnumParameter : public FWLongParameter
00031 {
00032 
00033    public:
00034    FWEnumParameter() : FWLongParameter()
00035    {}
00036 
00037    FWEnumParameter(FWParameterizable* iParent,
00038                    const std::string& iName,
00039                    const long &iDefault=0,
00040                    long iMin=-1,
00041                    long iMax=-1) :
00042       FWLongParameter(iParent, iName, iDefault, iMin, iMax)
00043    {}
00044 
00045    template <class K>
00046    FWEnumParameter(FWParameterizable* iParent,
00047                    const std::string& iName,
00048                    K iCallback,
00049                    const long &iDefault=0,
00050                    long iMin=-1,
00051                    long iMax=-1) :
00052       FWLongParameter(iParent, iName, iCallback, iDefault, iMin, iMax)
00053    {}
00054 
00055    // ---------- const member functions ---------------------
00056 
00057    // ---------- static member functions --------------------
00058 
00059    // ---------- member functions ---------------------------
00060 
00061    bool addEntry(Long_t id, const std::string& txt)
00062    {
00063       return m_enumEntries.insert(std::make_pair(id, txt)).second;
00064    }
00065 
00066    const std::map<Long_t, std::string>& entryMap() const { return m_enumEntries; }
00067 
00068 private:
00069    FWEnumParameter(const FWEnumParameter&);                  // stop default
00070    const FWEnumParameter& operator=(const FWEnumParameter&); // stop default
00071 
00072    // ---------- member data --------------------------------
00073    std::map<Long_t, std::string> m_enumEntries;
00074 };
00075 
00076 #endif