Changeset 352 for XIOS/trunk/src/node/variable.hpp
- Timestamp:
- 07/09/12 11:33:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/variable.hpp
r345 r352 64 64 template <typename T> inline T getData(void) const; 65 65 // bool inline getData<bool>(void) const ; 66 // template <> getData<bool>(void) const ; 66 67 67 68 template <typename T, StdSize N> … … 81 82 }; // class CVar 82 83 83 84 template<> 85 inline bool CVariable::getData(void) const 86 { 87 if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 88 else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 89 else ERROR("CVariable::getdata()", 90 << "Cannot convert string <" << content << "> into type required" ); 91 return false ; 92 } 93 84 94 template <typename T> 85 T CVariable::getData(void) const95 inline T CVariable::getData(void) const 86 96 { 87 97 T retval ; … … 94 104 } 95 105 96 template<> 97 bool CVariable::getData<bool>(void) const 98 { 99 if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 100 else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 101 else ERROR("CVariable::getdata()", 102 << "Cannot convert string <" << content << "> into type required" ); 103 return false ; 104 } 106 105 107 ///-------------------------------------------------------------- 106 108
Note: See TracChangeset
for help on using the changeset viewer.