Frobby  0.9.5
BoolParameter.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 BOOL_PARAMETER_GUARD
18 #define BOOL_PARAMETER_GUARD
19 
20 #include "Parameter.h"
21 #include <utility>
22 #include <string>
23 
24 class BoolParameter : public Parameter {
25 public:
26  BoolParameter(const string& name,
27  const string& description,
28  bool defaultValue);
29 
30  bool getValue() const {return _value;}
31  void setValue(bool value) {_value = value;}
32 
33  operator bool() const {return getValue();}
34  void operator=(bool value) {return 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  bool _value;
43 };
44 
45 #endif
void operator=(bool value)
Definition: BoolParameter.h:34
bool getValue() const
Definition: BoolParameter.h:30
BoolParameter(const string &name, const string &description, bool defaultValue)
virtual void doProcessArguments(const char **args, size_t argCount)
virtual string doGetArgumentType() const
virtual pair< size_t, size_t > doGetArgumentCountRange() const
void setValue(bool value)
Definition: BoolParameter.h:31
virtual string doGetValueAsString() const