00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef conf_int_H
00026 #define conf_int_H
00027
00028
00029 #include "platform.h"
00030
00031
00032 #include <climits>
00033 #include <string>
00034
00035
00036 #include "conf/conf.h"
00037
00038 namespace IXE {
00039
00048 template <> class conf<int> : public VarDefault<int>
00049 {
00050 public:
00057 conf(char const *name,
00058 int default_value, int min = 0, int max = INT_MAX);
00059
00060 conf<int>& operator =(int new_value);
00061
00062 conf<int>& operator =(char const* s) {
00063 parseValue(s);
00064 return *this;
00065 }
00066
00067 conf<int>& operator ++() {
00068 ++value;
00069 return *this;
00070 }
00071 conf<int> operator ++(int) {
00072 conf<int> tmp = *this;
00073 ++value;
00074 return tmp;
00075 }
00076 conf<int>& operator --() {
00077 --value;
00078 return *this;
00079 }
00080 conf<int> operator --(int) {
00081 conf<int> tmp = *this;
00082 --value;
00083 return tmp;
00084 }
00085
00086 protected:
00087 virtual void parseValue(char const*& line);
00088 private:
00089 int const min_, max_;
00090 };
00091
00092 }
00093
00094 #endif