Frobby 0.9.5
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
25public:
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
36private:
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
unsigned int _value
IntegerParameter(const string &name, const string &description, unsigned int defaultValue)
unsigned int getValue() const
void operator=(unsigned int value)
virtual void doProcessArguments(const char **args, size_t argCount)
void setValue(unsigned int value)
virtual string doGetValueAsString() const
virtual pair< size_t, size_t > doGetArgumentCountRange() const
virtual string doGetArgumentType() const