Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:01

0001 #ifndef Fireworks_Core_FWGenericParameterWithRange_h
0002 #define Fireworks_Core_FWGenericParameterWithRange_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWGenericParameterWithRange
0007 //
0008 /**\class FWGenericParameterWithRange FWGenericParameter.h Fireworks/Core/interface/FWLongParameter.h
0009 
0010    Description: Provides access to a simple double parameter
0011 
0012    Usage:
0013     If min and max values are both identical than no restriction is placed on the allowed value
0014 
0015  */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri Mar  7 14:36:34 EST 2008
0019 //
0020 
0021 // user include files
0022 #include "Fireworks/Core/interface/FWGenericParameter.h"
0023 
0024 // forward declarations
0025 
0026 template <class T>
0027 class FWGenericParameterWithRange : public FWGenericParameter<T> {
0028 public:
0029   FWGenericParameterWithRange(void) : FWGenericParameter<T>(), m_min(-1), m_max(-1) {}
0030 
0031   FWGenericParameterWithRange(
0032       FWParameterizable* iParent, const std::string& iName, const T& iDefault = T(), T iMin = -1, T iMax = -1)
0033       : FWGenericParameter<T>(iParent, iName, iDefault), m_min(iMin), m_max(iMax) {}
0034 
0035   template <class K>
0036   FWGenericParameterWithRange(FWParameterizable* iParent,
0037                               const std::string& iName,
0038                               K iCallback,
0039                               const T& iDefault = T(),
0040                               T iMin = -1,
0041                               T iMax = -1)
0042       : FWGenericParameter<T>(iParent, iName, iCallback, iDefault), m_min(iMin), m_max(iMax) {}
0043 
0044   // ---------- const member functions ---------------------
0045 
0046   T min() const { return m_min; }
0047   T max() const { return m_max; }
0048 
0049 private:
0050   T m_min;
0051   T m_max;
0052 };
0053 
0054 #endif