author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Sat, 04 Jul 2009 08:15:48 +0200 | |
changeset 4654 | 2eaebe77d66b |
parent 3365 | 6409d2460601 |
permissions | -rw-r--r-- |
2581
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
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:
2485
diff
changeset
|
2 |
/* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
diff
changeset
|
4 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
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:
2485
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:
2485
diff
changeset
|
7 |
* published by the Free Software Foundation; |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
diff
changeset
|
8 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
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:
2485
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:
2485
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:
2485
diff
changeset
|
12 |
* GNU General Public License for more details. |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
diff
changeset
|
13 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
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:
2485
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:
2485
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:
2485
diff
changeset
|
17 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
diff
changeset
|
18 |
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2485
diff
changeset
|
19 |
*/ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
20 |
#ifndef UINTEGER_H |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
21 |
#define UINTEGER_H |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
2438
e2ac9f9aeeb9
value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
23 |
#include "attribute.h" |
2451
8979f07befd5
value-helper.h -> attribute-helper.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2439
diff
changeset
|
24 |
#include "attribute-helper.h" |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include <stdint.h> |
3365
6409d2460601
bug 245: build failure with gcc 4.3.x
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3182
diff
changeset
|
26 |
#include <limits> |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
namespace ns3 { |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
30 |
/** |
3182 | 31 |
* \ingroup attribute |
32 |
* |
|
2968
d6b2d00acab2
add doxygen class definitions for native type Value classes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
33 |
* \class ns3::UintegerValue |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
34 |
* \brief Hold an unsigned integer type |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
35 |
* |
2928
554e10cdc747
add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
36 |
* \anchor uint8_t |
554e10cdc747
add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
37 |
* \anchor uint16_t |
554e10cdc747
add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
38 |
* \anchor uint32_t |
554e10cdc747
add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
39 |
* \anchor uint64_t |
554e10cdc747
add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
40 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
41 |
* This class can be used to hold variables of unsigned integer |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
42 |
* type such as uint8_t, uint16_t, uint32_t, uint64_t, or, |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
43 |
* unsigned int, etc. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
44 |
*/ |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2928
diff
changeset
|
46 |
ATTRIBUTE_VALUE_DEFINE_WITH_NAME (uint64_t, Uinteger); |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
47 |
ATTRIBUTE_ACCESSOR_DEFINE (Uinteger); |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
48 |
|
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2424
diff
changeset
|
49 |
template <typename T> |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
50 |
Ptr<const AttributeChecker> MakeUintegerChecker (void); |
2428
9c8d27c408db
move checker creation function to .cc file.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
51 |
|
2485
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
52 |
template <typename T> |
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
53 |
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min); |
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
54 |
|
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
55 |
template <typename T> |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
56 |
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max); |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
57 |
|
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
58 |
} // namespace ns3 |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
59 |
|
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
60 |
#include "type-name.h" |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
61 |
|
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
namespace ns3 { |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
63 |
|
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
64 |
namespace internal { |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
65 |
|
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
66 |
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max, std::string name); |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
67 |
|
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
68 |
} // namespace internal |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
69 |
|
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
70 |
|
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
71 |
template <typename T> |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
72 |
Ptr<const AttributeChecker> MakeUintegerChecker (void) |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
73 |
{ |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
74 |
return internal::MakeUintegerChecker (std::numeric_limits<T>::min (), |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
75 |
std::numeric_limits<T>::max (), |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
76 |
TypeNameGet<T> ()); |
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
77 |
} |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
78 |
|
2485
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
79 |
template <typename T> |
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
80 |
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min) |
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
81 |
{ |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
82 |
return internal::MakeUintegerChecker (min, |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
83 |
std::numeric_limits<T>::max (), |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
84 |
TypeNameGet<T> ()); |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
85 |
} |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
86 |
|
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
87 |
template <typename T> |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
88 |
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max) |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
89 |
{ |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
90 |
return internal::MakeUintegerChecker (min, |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
91 |
max, |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
92 |
TypeNameGet<T> ()); |
2485
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
93 |
} |
1590feefbf20
add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2455
diff
changeset
|
94 |
|
2379
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
95 |
} // namespace ns3 |
db1eb36bfaa4
forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
96 |
|
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
97 |
#endif /* UINTEGER_H */ |