source: branches/replacing_gnuplot/lib/Option.h @ 646

Last change on this file since 646 was 646, checked in by Jari Häkkinen, 13 years ago

Merged trunk changes r608:645 to replacing_gnuplot branch.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1#ifndef _theplu_svndigest_option_
2#define _theplu_svndigest_option_
3
4// $Id: Option.h 646 2008-06-03 22:05:22Z jari $
5
6/*
7  Copyright (C) 2008 Peter Johansson
8
9  This file is part of svndigest, http://trac.thep.lu.se/svndigest
10
11  svndigest is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15
16  svndigest is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  02111-1307, USA.
25*/
26
27#include <string>
28
29namespace theplu{
30namespace svndigest{
31
32  ///
33  /// Class taking care of cmd options in Parameter
34  ///
35  template<typename T>
36  class Option
37  {
38  public:
39    Option(T value): default_(value), value_(value) {}
40    inline const T& default_value(void) const { return default_; }
41    inline void reset(void) { value_=default_; }
42    inline T& value(void) { return value_; }
43    inline const T& value(void) const { return value_; }
44
45  private:
46    const T default_;
47    T value_;
48
49  };
50
51}} // end of namespace svndigest end of namespace theplu
52
53#endif
Note: See TracBrowser for help on using the repository browser.