declare_group.hpp 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __XIOS_DECLARE_GROUP__
  2. #define __XIOS_DECLARE_GROUP__
  3. /// ///////////////////////////// Macros ///////////////////////////// ///
  4. #define DECLARE_GROUP(type) \
  5. class type##Group \
  6. : public CGroupTemplate<type, type##Group, type##Attributes> \
  7. { \
  8. public: \
  9. typedef type RelChild; \
  10. typedef type##Group RelGroup; \
  11. typedef type##Attributes RelAttributes; \
  12. \
  13. type##Group(void) \
  14. : CGroupTemplate<RelChild, RelGroup, RelAttributes> () \
  15. { /* Ne rien faire de plus */ } \
  16. type##Group(const StdString& _id) \
  17. : CGroupTemplate<RelChild, RelGroup, RelAttributes> (_id) \
  18. { /* Ne rien faire de plus */ } \
  19. \
  20. static ENodeType GetType(void) \
  21. { return static_cast<ENodeType>(RelChild::GetType()+1); } \
  22. \
  23. virtual ~type##Group(void) \
  24. { /* Ne rien faire de plus */ } \
  25. }; \
  26. typedef type##Group type##Definition
  27. #define DECLARE_GROUP_PARSE_REDEF(type) \
  28. class type##Group \
  29. : public CGroupTemplate<type, type##Group, type##Attributes> \
  30. { \
  31. public: \
  32. typedef type RelChild; \
  33. typedef type##Group RelGroup; \
  34. typedef type##Attributes RelAttributes; \
  35. typedef CGroupTemplate<type, type##Group, type##Attributes> \
  36. SuperClass; \
  37. \
  38. type##Group(void) \
  39. : CGroupTemplate<RelChild, RelGroup, RelAttributes> () \
  40. { /* Ne rien faire de plus */ } \
  41. type##Group(const StdString& _id) \
  42. : CGroupTemplate<RelChild, RelGroup, RelAttributes> (_id) \
  43. { /* Ne rien faire de plus */ } \
  44. \
  45. static ENodeType GetType(void) \
  46. { return static_cast<ENodeType>(RelChild::GetType()+1); } \
  47. \
  48. virtual void parse(xml::CXMLNode & node, bool withAttr = true); \
  49. \
  50. virtual ~type##Group(void) \
  51. { /* Ne rien faire de plus */ } \
  52. }; \
  53. typedef type##Group type##Definition
  54. #endif // __XIOS_DECLARE_GROUP__