Ignore:
Timestamp:
11/02/15 11:46:25 (8 years ago)
Author:
mhnguyen
Message:

Implementing the reading of attributes of an axis from a file

+) 3d grid can be read directly from a file
+) Clean some redundant codes
+) Add new attribute declaration that allows to output only desired attributes

Test
+) On Curie
+) test_remap passes and result is correct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/declare_attribute.hpp

    r591 r775  
    33 
    44/// ///////////////////////////// Macros ///////////////////////////// /// 
    5  
    65#define DECLARE_ATTRIBUTE(type, name)                             \ 
    76   class name##_attr : public CAttributeTemplate<type>            \ 
     
    1817   } name; 
    1918 
     19#define DECLARE_ATTRIBUTE_PRIVATE(type, name)                    \ 
     20   class name##_attr : public CAttributeTemplate<type>           \ 
     21   {                                                              \ 
     22      public :                                                    \ 
     23         name##_attr(void)                                          \ 
     24            : CAttributeTemplate<type>                            \ 
     25            (#name, *CAttributeMap::Current)                      \ 
     26         { /* Ne rien faire de plus */ }                          \ 
     27         type operator=(const type & value)                       \ 
     28         { return (CAttributeTemplate<type>::operator=(value)); } \ 
     29         virtual bool isAttributePublic()                         \ 
     30         { return false; }                                        \ 
     31         virtual ~name##_attr(void)                               \ 
     32         { /* Ne rien faire de plus */ }                          \ 
     33   } name; 
     34 
    2035#define DECLARE_ARRAY(T_num, T_rank, name)                        \ 
    2136   class name##_attr : public CAttributeArray<T_num, T_rank>      \ 
     
    2641         virtual ~name##_attr(void) {}                            \ 
    2742   } name; 
    28     
     43 
     44#define DECLARE_ARRAY_PRIVATE(T_num, T_rank, name)                        \ 
     45   class name##_attr : public CAttributeArray<T_num, T_rank>      \ 
     46   {                                                              \ 
     47      public :                                                    \ 
     48         using CAttributeArray<T_num, T_rank>::operator = ;       \ 
     49         name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {} \ 
     50         virtual bool isAttributePublic()                         \ 
     51         { return false; }                                        \ 
     52         virtual ~name##_attr(void) {}                            \ 
     53   } name; 
     54 
    2955#define DECLARE_CLASS_ENUM(name)                                   \ 
    3056   class name##_attr : public CAttributeEnum<Enum_##name>          \ 
     
    3460         virtual ~name##_attr(void) {}                           \ 
    3561   } name; 
    36     
     62 
    3763#define DECLARE_ENUM2(name,arg1,arg2)                             \ 
    3864   class Enum_##name                                              \ 
     
    4470   } ;                                                            \ 
    4571   DECLARE_CLASS_ENUM(name) 
    46     
     72 
    4773#define DECLARE_ENUM3(name,arg1,arg2,arg3)                             \ 
    4874   class Enum_##name                                              \ 
     
    113139     int getSize(void) const { return 9 ; }                       \ 
    114140   } ;                                                            \ 
    115    DECLARE_CLASS_ENUM(name)  
     141   DECLARE_CLASS_ENUM(name) 
    116142 
    117143  #define DECLARE_TYPE(name)                                      \ 
Note: See TracChangeset for help on using the changeset viewer.