New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
declare_attribute.hpp in vendors/XIOS/r_357/src – NEMO

source: vendors/XIOS/r_357/src/declare_attribute.hpp @ 8531

Last change on this file since 8531 was 3428, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

File size: 2.1 KB
Line 
1#ifndef __XMLIO_DECLARE_ATTRIBUTE__
2#define __XMLIO_DECLARE_ATTRIBUTE__
3
4/// ///////////////////////////// Macros ///////////////////////////// ///
5
6#define DECLARE_ATTRIBUTE(type, name)                             \
7   class name##att : public CAttributeTemplate<type>{             \
8      public :                                                    \
9         name##att(void)                                          \
10            : CAttributeTemplate<type>                            \
11            (#name, *CAttributeMap::Current)                      \
12         { /* Ne rien faire de plus */ }                          \
13         type operator=(const type & value)                       \
14         { return (CAttributeTemplate<type>::operator=(value)); } \
15         virtual ~name##att(void)                                 \
16         { /* Ne rien faire de plus */ }                          \
17   } name;
18
19#define DECLARE_ATTRIBUTE_DEF(type, name, def)                     \
20   class name##att : public CAttributeTemplate<type>{              \
21      public :                                                     \
22         name##att(void)                                           \
23            : CAttributeTemplate<type>                             \
24            (#name, def, *CAttributeMap::Current)                  \
25         { /* Ne rien faire de plus */ }                           \
26         type operator=(const type & value)                        \
27         { return (CAttributeTemplate<type>::operator=(value)); }  \
28         virtual ~name##att(void)                                  \
29         { /* Ne rien faire de plus */ }                           \
30   } name;
31
32#define BEGIN_DECLARE_ATTRIBUTE_MAP(type)                  \
33   class type##Attributes : public virtual CAttributeMap { \
34      public :
35
36#define END_DECLARE_ATTRIBUTE_MAP(type)            \
37         type##Attributes (void) : CAttributeMap() \
38         { /* Ne rien faire de plus */ }           \
39         virtual ~type##Attributes (void)          \
40         { /* Ne rien faire de plus */ }           \
41   };
42
43#endif // __XMLIO_DECLARE_ATTRIBUTE__
Note: See TracBrowser for help on using the repository browser.