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_group.hpp in vendors/XIOS/current/src – NEMO

source: vendors/XIOS/current/src/declare_group.hpp @ 3408

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

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1#ifndef __XMLIO_DECLARE_GROUP__
2#define __XMLIO_DECLARE_GROUP__
3
4/// ///////////////////////////// Macros ///////////////////////////// ///
5
6#define DECLARE_GROUP(type)                                           \
7   class type##Group                                                  \
8      : public CGroupTemplate<type, type##Group, type##Attributes>    \
9   {                                                                  \
10      public:                                                         \
11         typedef type              RelChild;                          \
12         typedef type##Group       RelGroup;                          \
13         typedef type##Attributes  RelAttributes;                     \
14                                                                      \
15         type##Group(void)                                            \
16            : CGroupTemplate<RelChild, RelGroup, RelAttributes> ()    \
17         { /* Ne rien faire de plus */ }                              \
18         type##Group(const StdString& _id)                            \
19            : CGroupTemplate<RelChild, RelGroup, RelAttributes> (_id) \
20         { /* Ne rien faire de plus */ }                              \
21                                                                      \
22         static ENodeType GetType(void)                               \
23         { return static_cast<ENodeType>(RelChild::GetType()+1); }    \
24                                                                      \
25         virtual ~type##Group(void)                                   \
26         { /* Ne rien faire de plus */ }                              \
27   };                                                                 \
28   typedef type##Group type##Definition
29   
30#define DECLARE_GROUP_PARSE_REDEF(type)                                  \
31   class type##Group                                                     \
32      : public CGroupTemplate<type, type##Group, type##Attributes>       \
33   {                                                                     \
34      public:                                                            \
35         typedef type              RelChild;                             \
36         typedef type##Group       RelGroup;                             \
37         typedef type##Attributes  RelAttributes;                        \
38         typedef CGroupTemplate<type, type##Group, type##Attributes>     \
39                 SuperClass;                                             \
40                                                                         \
41         type##Group(void)                                               \
42            : CGroupTemplate<RelChild, RelGroup, RelAttributes> ()       \
43         { /* Ne rien faire de plus */ }                                 \
44         type##Group(const StdString& _id)                               \
45            : CGroupTemplate<RelChild, RelGroup, RelAttributes> (_id)    \
46         { /* Ne rien faire de plus */ }                                 \
47                                                                         \
48         static ENodeType GetType(void)                                  \
49         { return static_cast<ENodeType>(RelChild::GetType()+1); }       \
50                                                                         \
51         virtual void parse(xml::CXMLNode & node, bool withAttr = true); \
52                                                                         \
53         virtual ~type##Group(void)                                      \
54         { /* Ne rien faire de plus */ }                                 \
55   };                                                                    \
56   typedef type##Group type##Definition
57
58#endif // __XMLIO_DECLARE_GROUP__
Note: See TracBrowser for help on using the repository browser.