author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Mon, 10 Mar 2008 14:05:26 -0700 | |
changeset 2584 | 5011c132ed6c |
parent 2582 | 3e28107b870f |
child 2599 | fcc1728eb669 |
permissions | -rw-r--r-- |
2581
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
2 |
/* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
4 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
7 |
* published by the Free Software Foundation; |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
8 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
12 |
* GNU General Public License for more details. |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
13 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
17 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
18 |
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
19 |
*/ |
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
20 |
#ifndef ATTRIBUTE_HELPER_H |
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
21 |
#define ATTRIBUTE_HELPER_H |
2422 | 22 |
|
2502
50d0da37f02f
introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
23 |
#include "attribute.h" |
50d0da37f02f
introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
24 |
#include "object-base.h" |
2449
30127bc12056
param-spec-helper.h -> attribute-accessor-helper.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2446
diff
changeset
|
25 |
#include "attribute-accessor-helper.h" |
2446
f2a03c7d069c
fix includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2443
diff
changeset
|
26 |
#include <sstream> |
f2a03c7d069c
fix includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2443
diff
changeset
|
27 |
#include "fatal-error.h" |
2422 | 28 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
29 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
30 |
* \defgroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
31 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
32 |
* All these macros can be used to generate automatically the code |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
33 |
* for subclasses of AttributeValue, AttributeAccessor, and, AttributeChecker, |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
34 |
* which can be used to give attribute powers to a normal class. i.e., |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
35 |
* the user class can then effectively be made an attribute. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
36 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
37 |
* There are two kinds of helper macros: |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
38 |
* 1) The simple macros. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
39 |
* 2) The more complex macros. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
40 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
41 |
* The simple macros are implemented in terms of the complex |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
42 |
* macros and should generally be prefered over the complex macros: |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
43 |
* - ATTRIBUTE_HELPER_HEADER_1, |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
44 |
* - ATTRIBUTE_HELPER_HEADER_2, and, |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
45 |
* - ATTRIBUTE_HELPER_CPP, |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
46 |
*/ |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
47 |
|
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
48 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
49 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
50 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
51 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
52 |
* This macro defines and generates the code for the implementation |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
53 |
* of the MakeXXXAccessor template functions. This macro is typically |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
54 |
* invoked in a class header to allow users of this class to view and |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
55 |
* use the template functions defined here. This macro is implemented |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
56 |
* through the helper templates functions ns3::MakeAccessorHelper<>. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
57 |
*/ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
58 |
#define ATTRIBUTE_ACCESSOR_DEFINE(type) \ |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
59 |
template <typename T1> \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
60 |
Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1) \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
61 |
{ \ |
2520
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
62 |
return MakeAccessorHelper<type##Value> (a1); \ |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
63 |
} \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
64 |
template <typename T1, typename T2> \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
65 |
Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1, T2 a2) \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
66 |
{ \ |
2520
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
67 |
return MakeAccessorHelper<type##Value> (a1, a2); \ |
2422 | 68 |
} |
69 |
||
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
70 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
71 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
72 |
* \param type the name of the class. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
73 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
74 |
* This macro defines the class XXXValue associated to class XXX. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
75 |
* This macro is typically invoked in a class header. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
76 |
*/ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
77 |
#define ATTRIBUTE_VALUE_DEFINE(type) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
78 |
class type##Value : public AttributeValue \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
79 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
80 |
public: \ |
2520
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
81 |
type##Value (); \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
82 |
type##Value (const type &value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
83 |
void Set (const type &value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
84 |
type Get (void) const; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
85 |
virtual Attribute Copy (void) const; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
86 |
virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
87 |
virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
88 |
type##Value (Attribute value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
89 |
operator Attribute () const; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
90 |
private: \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
91 |
type m_value; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
92 |
}; |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
93 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
94 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
95 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
96 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
97 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
98 |
* This macro defines the conversion operators for class XXX to and |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
99 |
* from instances of type Attribute. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
100 |
* Typically invoked from xxx.h. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
101 |
*/ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
102 |
#define ATTRIBUTE_CONVERTER_DEFINE(type) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
103 |
type (Attribute value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
104 |
operator Attribute () const; |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
105 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
106 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
107 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
108 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
109 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
110 |
* This macro defines the XXXChecker class and the associated |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
111 |
* MakeXXXChecker function. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
112 |
* Typically invoked from xxx.h. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
113 |
*/ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
114 |
#define ATTRIBUTE_CHECKER_DEFINE(type) \ |
2473
24e929fe7d4c
add a base arg to MakeSimpleAttributeChecker
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2461
diff
changeset
|
115 |
class type##Checker : public AttributeChecker {}; \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
116 |
Ptr<const AttributeChecker> Make##type##Checker (void); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
117 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
118 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
119 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
120 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
121 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
122 |
* This macro implements the XXXValue class (without the |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
123 |
* XXXValue::SerializeToString and XXXValue::DeserializeFromString |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
124 |
* methods). |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
125 |
* Typically invoked from xxx.cc. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
126 |
*/ |
2515
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
127 |
#define ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE(type) \ |
2520
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
128 |
type##Value::type##Value () \ |
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
129 |
: m_value () {} \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
130 |
type##Value::type##Value (const type &value) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
131 |
: m_value (value) {} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
132 |
void type##Value::Set (const type &v) { \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
133 |
m_value = v; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
134 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
135 |
type type##Value::Get (void) const { \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
136 |
return m_value; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
137 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
138 |
Attribute \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
139 |
type##Value::Copy (void) const { \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
140 |
return Attribute::Create<type##Value> (*this); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
141 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
142 |
type##Value::type##Value (Attribute value) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
143 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
144 |
type##Value *v = value.DynCast<type##Value *> (); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
145 |
if (v == 0) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
146 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
147 |
NS_FATAL_ERROR ("Unexpected type of value. Expected \"" << #type << "Value\""); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
148 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
149 |
m_value = v->Get (); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
150 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
151 |
type##Value::operator Attribute () const \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
152 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
153 |
return Attribute::Create<type##Value> (*this); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
154 |
} |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
155 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
156 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
157 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
158 |
* \param type the name of the class. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
159 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
160 |
* This macro implements the XXXValue class (including the |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
161 |
* XXXValue::SerializeToString and XXXValue::DeserializeFromString |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
162 |
* methods). |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
163 |
* Typically invoked from xxx.cc. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
164 |
*/ |
2515
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
165 |
#define ATTRIBUTE_VALUE_IMPLEMENT(type) \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
166 |
std::string \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
167 |
type##Value::SerializeToString (Ptr<const AttributeChecker> checker) const { \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
168 |
std::ostringstream oss; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
169 |
oss << m_value; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
170 |
return oss.str (); \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
171 |
} \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
172 |
bool \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
173 |
type##Value::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) { \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
174 |
std::istringstream iss; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
175 |
iss.str (value); \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
176 |
iss >> m_value; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
177 |
return !iss.bad () && !iss.fail (); \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
178 |
} \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
179 |
ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE (type) |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
180 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
181 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
182 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
183 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
184 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
185 |
* This macro implements the MakeXXXChecker function. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
186 |
* Typically invoked from xxx.cc. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
187 |
*/ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
188 |
#define ATTRIBUTE_CHECKER_IMPLEMENT(type) \ |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
189 |
Ptr<const AttributeChecker> Make##type##Checker (void) \ |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
190 |
{ \ |
2473
24e929fe7d4c
add a base arg to MakeSimpleAttributeChecker
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2461
diff
changeset
|
191 |
return MakeSimpleAttributeChecker<type##Value,type##Checker> (); \ |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
192 |
} \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
193 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
194 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
195 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
196 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
197 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
198 |
* This macro implements the conversion operators to and from |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
199 |
* instances of type Attribute. Typically invoked from xxx.cc. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
200 |
*/ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
201 |
#define ATTRIBUTE_CONVERTER_IMPLEMENT(type) \ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
202 |
type::type (Attribute value) \ |
2422 | 203 |
{ \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
204 |
const type##Value *v = value.DynCast<const type##Value *> (); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
205 |
if (v == 0) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
206 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
207 |
NS_FATAL_ERROR ("Unexpected type of value. Expected \"" << #type << "Value\""); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
208 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
209 |
*this = v->Get (); \ |
2422 | 210 |
} \ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
211 |
type::operator Attribute () const \ |
2422 | 212 |
{ \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
213 |
return Attribute::Create<type##Value> (*this); \ |
2422 | 214 |
} |
215 |
||
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
216 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
217 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
218 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
219 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
220 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
221 |
* This macro should be invoked from a public section of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
222 |
* declaration. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
223 |
*/ |
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
224 |
#define ATTRIBUTE_HELPER_HEADER_1(type) \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
225 |
ATTRIBUTE_CONVERTER_DEFINE (type) |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
226 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
227 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
228 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
229 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
230 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
231 |
* This macro should be invoked outside of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
232 |
* declaration in its public header. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
233 |
*/ |
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
234 |
#define ATTRIBUTE_HELPER_HEADER_2(type) \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
235 |
ATTRIBUTE_VALUE_DEFINE (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
236 |
ATTRIBUTE_ACCESSOR_DEFINE (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
237 |
ATTRIBUTE_CHECKER_DEFINE (type); |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
238 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
239 |
/** |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
240 |
* \ingroup AttributeHelper |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
241 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
242 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
243 |
* This macro should be invoked from the class implementation file. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
244 |
*/ |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
245 |
#define ATTRIBUTE_HELPER_CPP(type) \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
246 |
ATTRIBUTE_CHECKER_IMPLEMENT (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
247 |
ATTRIBUTE_CONVERTER_IMPLEMENT (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
248 |
ATTRIBUTE_VALUE_IMPLEMENT (type); |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
249 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
250 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
251 |
|
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
252 |
#endif /* ATTRIBUTE_HELPER_H */ |