source: XMLIO_V2/dev/dev_rv/src/XMLIO/declare_attribut.hpp @ 128

Last change on this file since 128 was 128, checked in by hozdoba, 14 years ago
File size: 2.4 KB
RevLine 
[98]1#ifndef __DECLARE_ATTRIBUT__
2#define __DECLARE_ATTRIBUT__
3
[79]4#include "attribut.hpp"
5
[120]6#define Array(x,y) Array<x,y>
7
[126]8#define DECLARE_ATTR(att_name, att_type)              \
9   class Attr_##att_name : public Attribut<att_type>  \
[98]10   {                                                  \
11      public:                                         \
[126]12                                                      \
13         virtual string       getName(void) const { return (#att_name) ;}           \
14         virtual const char * getType(void) const { return (#att_type) ;}           \
15                                                                                    \
16         Attr_##att_name(void) : Attribut<att_type>()                               \
17         { /* Ne rien faire de plus */ }                                            \
18         Attr_##att_name(const att_type& _value) : Attribut<att_type>(_value)       \
19         { /* Ne rien faire de plus */ }                                            \
[127]20         Attr_##att_name(const Attr_##att_name& _att) : Attribut<att_type>(_att)    \
[126]21         { /* Ne rien faire de plus */ }                                            \
22                                                                                    \
23         virtual ~Attr_##att_name()                                                 \
24         { /* Ne rien faire de plus */ }                                            \
25   };                                                                               \
26                                                                                    \
27   const Attr_##att_name& getAttr_##att_name(void) const { return (att_name); }     \
28   const Attr_##att_name& get_##att_name(void)     const { return (att_name); }     \
29                                                                                    \
30   void setAttr##att_name(const Attr_##att_name& _newattr) { att_name = _newattr; } \
[128]31   void set_##att_name   (const Attr_##att_name& _newattr) { att_name = _newattr; }\
[126]32                                                                                    \
33   void setAttr##att_name(const att_type& _newattr) { att_name.setValue(_newattr); }\
34   void set_##att_name   (const att_type& _newattr) { att_name.setValue(_newattr); }\
[127]35                                                                                    \
[126]36   Attr_##att_name att_name
[79]37
[98]38#endif // __DECLARE_ATTRIBUT__
Note: See TracBrowser for help on using the repository browser.