source: XIOS/dev/dev_rv/src4/xmlio/declare_attribute.hpp @ 2338

Last change on this file since 2338 was 260, checked in by hozdoba, 13 years ago

Ajout de classes pour la version 4

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