author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Sun, 02 Mar 2008 21:00:37 +0100 | |
changeset 2531 | b451b5fc8b57 |
parent 2520 | a4896ebf6e1d |
child 2581 | 31d4960dc31b |
permissions | -rw-r--r-- |
2422 | 1 |
#ifndef VALUE_HELPER_H |
2 |
#define VALUE_HELPER_H |
|
3 |
||
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
|
4 |
#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
|
5 |
#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
|
6 |
#include "attribute-accessor-helper.h" |
2446
f2a03c7d069c
fix includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2443
diff
changeset
|
7 |
#include <sstream> |
f2a03c7d069c
fix includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2443
diff
changeset
|
8 |
#include "fatal-error.h" |
2422 | 9 |
|
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
10 |
#define ATTRIBUTE_ACCESSOR_DEFINE(type) \ |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
11 |
template <typename T1> \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
12 |
Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1) \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
13 |
{ \ |
2520
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
14 |
return MakeAccessorHelper<type##Value> (a1); \ |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
15 |
} \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
16 |
template <typename T1, typename T2> \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
17 |
Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1, T2 a2) \ |
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
18 |
{ \ |
2520
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
19 |
return MakeAccessorHelper<type##Value> (a1, a2); \ |
2422 | 20 |
} |
21 |
||
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
22 |
#define ATTRIBUTE_VALUE_DEFINE(type) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
23 |
class type##Value : public AttributeValue \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
24 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
25 |
public: \ |
2520
a4896ebf6e1d
introduce AttributeChecker::Create and use it instead of AttributeValue::Copy.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2515
diff
changeset
|
26 |
type##Value (); \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
27 |
type##Value (const type &value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
28 |
void Set (const type &value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
29 |
type Get (void) const; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
30 |
virtual Attribute Copy (void) const; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
31 |
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
|
32 |
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
|
33 |
type##Value (Attribute value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
34 |
operator Attribute () const; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
35 |
private: \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
36 |
type m_value; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
37 |
}; |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
38 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
39 |
#define ATTRIBUTE_CONVERTER_DEFINE(type) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
40 |
type (Attribute value); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
41 |
operator Attribute () const; |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
42 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
43 |
#define ATTRIBUTE_CHECKER_DEFINE(type) \ |
2473
24e929fe7d4c
add a base arg to MakeSimpleAttributeChecker
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2461
diff
changeset
|
44 |
class type##Checker : public AttributeChecker {}; \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
45 |
Ptr<const AttributeChecker> Make##type##Checker (void); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
46 |
|
2515
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
47 |
#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
|
48 |
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
|
49 |
: m_value () {} \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
50 |
type##Value::type##Value (const type &value) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
51 |
: m_value (value) {} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
52 |
void type##Value::Set (const type &v) { \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
53 |
m_value = v; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
54 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
55 |
type type##Value::Get (void) const { \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
56 |
return m_value; \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
57 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
58 |
Attribute \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
59 |
type##Value::Copy (void) const { \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
60 |
return Attribute::Create<type##Value> (*this); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
61 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
62 |
type##Value::type##Value (Attribute value) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
63 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
64 |
type##Value *v = value.DynCast<type##Value *> (); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
65 |
if (v == 0) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
66 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
67 |
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
|
68 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
69 |
m_value = v->Get (); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
70 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
71 |
type##Value::operator Attribute () const \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
72 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
73 |
return Attribute::Create<type##Value> (*this); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
74 |
} |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
75 |
|
2515
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
76 |
#define ATTRIBUTE_VALUE_IMPLEMENT(type) \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
77 |
std::string \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
78 |
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
|
79 |
std::ostringstream oss; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
80 |
oss << m_value; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
81 |
return oss.str (); \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
82 |
} \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
83 |
bool \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
84 |
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
|
85 |
std::istringstream iss; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
86 |
iss.str (value); \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
87 |
iss >> m_value; \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
88 |
return !iss.bad () && !iss.fail (); \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
89 |
} \ |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
90 |
ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE (type) |
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
91 |
|
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
92 |
#define ATTRIBUTE_CHECKER_IMPLEMENT(type) \ |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
93 |
Ptr<const AttributeChecker> Make##type##Checker (void) \ |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
94 |
{ \ |
2473
24e929fe7d4c
add a base arg to MakeSimpleAttributeChecker
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2461
diff
changeset
|
95 |
return MakeSimpleAttributeChecker<type##Value,type##Checker> (); \ |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
96 |
} \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
97 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
98 |
#define ATTRIBUTE_CONVERTER_IMPLEMENT(type) \ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
99 |
type::type (Attribute value) \ |
2422 | 100 |
{ \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
101 |
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
|
102 |
if (v == 0) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
103 |
{ \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
104 |
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
|
105 |
} \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
106 |
*this = v->Get (); \ |
2422 | 107 |
} \ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
108 |
type::operator Attribute () const \ |
2422 | 109 |
{ \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
110 |
return Attribute::Create<type##Value> (*this); \ |
2422 | 111 |
} |
112 |
||
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
113 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
114 |
#define VALUE_HELPER_HEADER_1(type) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
115 |
ATTRIBUTE_CONVERTER_DEFINE (type) |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
116 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
117 |
#define VALUE_HELPER_HEADER_2(type) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
118 |
ATTRIBUTE_VALUE_DEFINE (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
119 |
ATTRIBUTE_ACCESSOR_DEFINE (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
120 |
ATTRIBUTE_CHECKER_DEFINE (type); |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
121 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
122 |
#define VALUE_HELPER_CPP(type) \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
123 |
ATTRIBUTE_CHECKER_IMPLEMENT (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
124 |
ATTRIBUTE_CONVERTER_IMPLEMENT (type); \ |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
125 |
ATTRIBUTE_VALUE_IMPLEMENT (type); |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
126 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
127 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
128 |
|
2422 | 129 |
#endif /* VALUE_HELPER_H */ |