author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Wed, 20 Feb 2008 21:45:42 +0100 | |
changeset 2438 | e2ac9f9aeeb9 |
parent 2437 | 44e34ffee8e3 |
child 2439 | 4a0b22a3f5fa |
permissions | -rw-r--r-- |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
#ifndef UINT_VALUE_H |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
#define UINT_VALUE_H |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
|
2438
e2ac9f9aeeb9
value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
4 |
#include "attribute.h" |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
#include "param-spec-helper.h" |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
#include <stdint.h> |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
namespace ns3 { |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
|
2437
44e34ffee8e3
Value -> AttributeValue
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2436
diff
changeset
|
10 |
class UintValue : public AttributeValue |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
{ |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
public: |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
UintValue (uint64_t value); |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2428
diff
changeset
|
14 |
virtual Attribute Copy (void) const; |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
15 |
virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const; |
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
16 |
virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker); |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
void Set (uint64_t value); |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
uint64_t Get (void) const; |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2428
diff
changeset
|
21 |
UintValue (Attribute value); |
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2428
diff
changeset
|
22 |
operator Attribute () const; |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
private: |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
uint64_t m_value; |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
}; |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
27 |
class UintAccessor : public AttributeAccessor {}; |
2410
88dc7d4a6731
introduce top-level ParamSpec for bindings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2408
diff
changeset
|
28 |
|
2408
04fe819b3ad1
rework param-spec-helper code to avoid having to deal with pointers to member functions et al.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2379
diff
changeset
|
29 |
template <typename T1> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
30 |
Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1); |
2408
04fe819b3ad1
rework param-spec-helper code to avoid having to deal with pointers to member functions et al.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2379
diff
changeset
|
31 |
template <typename T1, typename T2> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
32 |
Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1, T2 a2); |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
33 |
|
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
34 |
template <typename T> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
35 |
Ptr<const AttributeChecker> MakeUintChecker (void); |
2428
9c8d27c408db
move checker creation function to .cc file.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
36 |
|
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
37 |
Ptr<const AttributeChecker> MakeUintChecker (uint64_t min, uint64_t max); |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
} // namespace ns3 |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
namespace ns3 { |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
|
2408
04fe819b3ad1
rework param-spec-helper code to avoid having to deal with pointers to member functions et al.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2379
diff
changeset
|
43 |
template <typename T1> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
44 |
Ptr<const AttributeAccessor> |
2435
3128175f5866
ParamSpec -> Accessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
45 |
MakeUintAccessor (T1 a1) |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
{ |
2435
3128175f5866
ParamSpec -> Accessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
47 |
return MakeAccessorHelper<UintAccessor,UintValue> (a1); |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
} |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
49 |
|
2408
04fe819b3ad1
rework param-spec-helper code to avoid having to deal with pointers to member functions et al.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2379
diff
changeset
|
50 |
template <typename T1, typename T2> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
51 |
Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1, T2 a2) |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
52 |
{ |
2435
3128175f5866
ParamSpec -> Accessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
53 |
return MakeAccessorHelper<UintAccessor,UintValue> (a1, a2); |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
54 |
} |
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
55 |
|
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
56 |
template <typename T> |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
57 |
Ptr<const AttributeChecker> MakeUintChecker (void) |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
58 |
{ |
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
59 |
return MakeUintChecker (std::numeric_limits<T>::min (), |
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
60 |
std::numeric_limits<T>::max ()); |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
61 |
} |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
63 |
} // namespace ns3 |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
64 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
65 |
#endif /* UINT_PARAMETER_H */ |