Frobby  0.9.0
IntegerParameter.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see http://www.gnu.org/licenses/.
16 */
17 #ifndef INTEGER_PARAMETER_GUARD
18 #define INTEGER_PARAMETER_GUARD
19 
20 #include "Parameter.h"
21 #include <utility>
22 #include <string>
23 
24 class IntegerParameter : public Parameter {
25 public:
26  IntegerParameter(const string& name,
27  const string& description,
28  unsigned int defaultValue);
29 
30  unsigned int getValue() const {return _value;}
31  void setValue(unsigned int value) {_value = value;}
32 
33  operator unsigned int() const {return getValue();}
34  void operator=(unsigned int value) {setValue(value);}
35 
36 private:
37  virtual string doGetArgumentType() const;
38  virtual string doGetValueAsString() const;
39  virtual pair<size_t, size_t> doGetArgumentCountRange() const;
40  virtual void doProcessArguments(const char** args, size_t argCount);
41 
42  unsigned int _value;
43 };
44 
45 #endif
IntegerParameter::operator=
void operator=(unsigned int value)
Definition: IntegerParameter.h:34
Parameter
Definition: Parameter.h:24
IntegerParameter::IntegerParameter
IntegerParameter(const string &name, const string &description, unsigned int defaultValue)
Definition: IntegerParameter.cpp:23
IntegerParameter::doGetValueAsString
virtual string doGetValueAsString() const
Definition: IntegerParameter.cpp:34
IntegerParameter::doGetArgumentCountRange
virtual pair< size_t, size_t > doGetArgumentCountRange() const
Definition: IntegerParameter.cpp:40
IntegerParameter::_value
unsigned int _value
Definition: IntegerParameter.h:42
IntegerParameter::doGetArgumentType
virtual string doGetArgumentType() const
Definition: IntegerParameter.cpp:30
IntegerParameter
Definition: IntegerParameter.h:24
Parameter.h
IntegerParameter::getValue
unsigned int getValue() const
Definition: IntegerParameter.h:30
IntegerParameter::setValue
void setValue(unsigned int value)
Definition: IntegerParameter.h:31
IntegerParameter::doProcessArguments
virtual void doProcessArguments(const char **args, size_t argCount)
Definition: IntegerParameter.cpp:44