FWEnumParameter

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
#ifndef Fireworks_Core_FWEnumParameter_h
#define Fireworks_Core_FWEnumParameter_h
// -*- C++ -*-
//
// Package:     Core
// Class  :     FWEnumParameter
//
/**\class FWEnumParameter FWEnumParameter.h Fireworks/Core/interface/FWEnumParameter.h

 Description: Specialization of FWLongParameter to allow drop-down menu GUI.

 Usage:
    <usage>

*/
//
// Original Author:  matevz
//         Created:  Fri Apr 30 15:16:55 CEST 2010
//

// system include files

// user include files
#include "Fireworks/Core/interface/FWLongParameter.h"
#include "RtypesCore.h"
#include <map>

// forward declarations

class FWEnumParameter : public FWLongParameter {
public:
  FWEnumParameter() : FWLongParameter() {}

  FWEnumParameter(
      FWParameterizable* iParent, const std::string& iName, const long& iDefault = 0, long iMin = -1, long iMax = -1)
      : FWLongParameter(iParent, iName, iDefault, iMin, iMax) {}

  template <class K>
  FWEnumParameter(FWParameterizable* iParent,
                  const std::string& iName,
                  K iCallback,
                  const long& iDefault = 0,
                  long iMin = -1,
                  long iMax = -1)
      : FWLongParameter(iParent, iName, iCallback, iDefault, iMin, iMax) {}

  // ---------- const member functions ---------------------

  // ---------- static member functions --------------------

  // ---------- member functions ---------------------------

  bool addEntry(Long_t id, const std::string& txt) { return m_enumEntries.insert(std::make_pair(id, txt)).second; }

  const std::map<Long_t, std::string>& entryMap() const { return m_enumEntries; }

  FWEnumParameter(const FWEnumParameter&) = delete;                   // stop default
  const FWEnumParameter& operator=(const FWEnumParameter&) = delete;  // stop default

private:
  // ---------- member data --------------------------------
  std::map<Long_t, std::string> m_enumEntries;
};

#endif