Ignore:
Timestamp:
12/03/14 11:41:54 (7 years ago)
Author:
rlacroix
Message:

Make the variable typing stricter.

The type must now be one of:

  • bool
  • int or int32
  • int16
  • int64
  • float
  • double
  • string

WARNING: The variable type was previously not checked and using an unsupported type did not lead to any error message. Be aware that this change can make your existing configuration files invalid. However the adjustments required to adapt existing files should be minor.

File:
1 edited

Legend:

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

    r501 r527  
    7070   } 
    7171 
    72    CVariable::EVarType CVariable::getVarType(void) const 
    73    { 
    74      EVarType ret ; 
    75  
    76      if (type.isEmpty()) ret=t_undefined ; 
    77      else 
    78      { 
    79        string varType=boost::to_lower_copy(boost::trim_copy(type.getValue())) ; 
    80        if (varType=="int") ret=t_int ; 
    81        else if (varType=="short int" || varType=="short") ret=t_short_int ; 
    82        else if (varType=="long int" || varType=="long") ret=t_long_int ; 
    83        else if (varType=="float") ret=t_float ; 
    84        else if (varType=="double") ret=t_double ; 
    85        else if (varType=="long double") ret=t_long_double ; 
    86        else if (varType=="bool") ret=t_bool ; 
    87        else if (varType=="long double") ret=t_long_double ; 
    88        else if (varType=="string") ret=t_string ; 
    89      } 
    90      return ret ; 
    91    } 
    92  
    9372   /* 
    9473   *\brief Sending value of a variable with its id from client to server 
     
    126105      get(id)->recvValue(*buffer); 
    127106   } 
    128  
    129107 
    130108   /* 
Note: See TracChangeset for help on using the changeset viewer.