ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/io/Globals.hpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/io/Globals.hpp (file contents):
Revision 2372 by tim, Mon Oct 17 00:51:16 2005 UTC vs.
Revision 2373 by tim, Mon Oct 17 03:06:29 2005 UTC

# Line 66 | Line 66 | template<typename T> static RepType convert(T v)      
66   template<typename T> static bool    convert(T v, RepType& r){return false;} // !NB everything is ok
67   template<typename T> static RepType convert(T v)            {RepType tmp; convert(v,tmp);return tmp;}
68    static bool convert(RepType v, RepType& r) { r = v; return true;}
69 <  static char* getParamType() { return "std::string";}  
69 >  static std::string getParamType() { return "string";}  
70   };
71   //bool
72   template<>                    
# Line 87 | Line 87 | struct ParameterTraits<bool>{
87      
88       return result;
89    }
90 <  static char* getParamType() { return "bool";}  
90 >  static std::string getParamType() { return "bool";}  
91   };
92  
93   //int  
# Line 97 | Line 97 | struct ParameterTraits<int>{
97      template<typename T> static bool    convert(T, RepType&){return false;}
98      template<typename T> static RepType convert(T v)        {RepType tmp; convert(v,tmp);return tmp;}
99      static bool convert(RepType v, RepType& r)            { r=v; return true;}
100 <    static char* getParamType() { return "int";}  
100 >    static std::string getParamType() { return "int";}  
101   };
102  
103   //double
# Line 108 | Line 108 | struct ParameterTraits<double>{
108      template<typename T> static RepType convert(T v)        {RepType tmp; convert(v,tmp);return tmp;}
109      static bool convert(RepType v, RepType& r)            {r=v; return true;}
110      static bool convert(int v, RepType& r)                {r = static_cast<double>(v); return true;}
111 <    static char* getParamType() { return "double";}    
111 >    static std::string getParamType() { return "double";}    
112   };
113  
114  
# Line 125 | Line 125 | class ParameterBase {
125      virtual bool setData(std::string) = 0;
126      virtual bool setData(int) = 0;
127      virtual bool setData(double) = 0;
128 <    virtual char* getParamType() = 0;
128 >    virtual std::string getParamType() = 0;
129    protected:
130      std::string keyword_;
131      bool optional_;
# Line 151 | Line 151 | class Parameter : public ParameterBase{
151          return internalSetData<double>(dval);
152      }
153  
154 <    virtual char* getParamType() { return ParameterTraits<ParamType>::getParamType();}
154 >    virtual std::string getParamType() { return ParameterTraits<ParamType>::getParamType();}
155     private:
156       template<class T> bool internalSetData(T data) {
157          ParamType tmp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines