Ignore:
Timestamp:
07/09/12 11:33:05 (12 years ago)
Author:
ymipsl
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/variable.hpp

    r345 r352  
    6464            template <typename T> inline T getData(void) const; 
    6565//            bool inline getData<bool>(void) const ; 
     66//            template <> getData<bool>(void) const ; 
    6667             
    6768            template <typename T, StdSize N> 
     
    8182      }; // class CVar 
    8283 
    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       
    8494      template <typename T> 
    85       T CVariable::getData(void) const 
     95      inline T CVariable::getData(void) const 
    8696      { 
    8797         T retval ; 
     
    94104      }  
    95105 
    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 
    105107      ///-------------------------------------------------------------- 
    106108 
Note: See TracChangeset for help on using the changeset viewer.