Ignore:
Timestamp:
12/03/14 11:41:54 (9 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/declare_attribute.hpp

    r522 r527  
    115115   DECLARE_CLASS_ENUM(name)  
    116116 
     117  #define DECLARE_TYPE(name)                                      \ 
     118   class Enum_##name                                              \ 
     119   {                                                              \ 
     120     public:                                                      \ 
     121     enum t_enum { t_bool=0, t_int16, t_int, t_int32, t_int64, t_float, t_double, t_string }; \ 
     122     const char** getStr(void) const { static const char * enumStr[] = { "bool", "int16", "int", "int32", "int64", "float", "double", "string" }; return enumStr; } \ 
     123     int getSize(void) const { return 8; }                        \ 
     124   };                                                             \ 
     125   DECLARE_CLASS_ENUM(name) 
    117126 
    118127#define BEGIN_DECLARE_ATTRIBUTE_MAP(type)                  \ 
Note: See TracChangeset for help on using the changeset viewer.