OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
19 */ | 19 */ |
20 #ifndef INTEGER_H | 20 #ifndef INTEGER_H |
21 #define INTEGER_H | 21 #define INTEGER_H |
22 | 22 |
23 #include "attribute.h" | 23 #include "attribute.h" |
24 #include "attribute-helper.h" | 24 #include "attribute-helper.h" |
25 #include <stdint.h> | 25 #include <stdint.h> |
26 #include <limits> | 26 #include <limits> |
27 | 27 |
| 28 #include "ns3/ns3-module.h" |
| 29 #define NS3_MODULE NS3_CORE_MODULE |
| 30 #include "ns3/ns3-export.h" |
| 31 |
28 /** | 32 /** |
29 * \file | 33 * \file |
30 * \ingroup attribute_Integer | 34 * \ingroup attribute_Integer |
31 * ns3::IntegerValue attribute value declarations and template implementations. | 35 * ns3::IntegerValue attribute value declarations and template implementations. |
32 */ | 36 */ |
33 | 37 |
34 namespace ns3 { | 38 namespace ns3 { |
35 | 39 |
36 // Additional docs for class IntegerValue: | 40 // Additional docs for class IntegerValue: |
37 /** | 41 /** |
38 * Hold a signed integer type | 42 * Hold a signed integer type |
39 * | 43 * |
40 * This class can be used to hold variables of signed integer | 44 * This class can be used to hold variables of signed integer |
41 * type such as int8_t, int16_t, int32_t, int64_t, or, | 45 * type such as int8_t, int16_t, int32_t, int64_t, or, |
42 * int, etc. | 46 * int, etc. |
43 */ | 47 */ |
44 ATTRIBUTE_VALUE_DEFINE_WITH_NAME (int64_t, Integer); | 48 ATTRIBUTE_VALUE_DEFINE_WITH_NAME_LIB (int64_t, Integer, NS3_EXPORT); |
45 ATTRIBUTE_ACCESSOR_DEFINE (Integer); | 49 ATTRIBUTE_ACCESSOR_DEFINE_LIB (Integer, NS3_EXPORT); |
46 | 50 |
47 template <typename T> | 51 template <typename T> |
48 Ptr<const AttributeChecker> MakeIntegerChecker (void); | 52 Ptr<const AttributeChecker> MakeIntegerChecker (void); |
49 | 53 |
50 /** | 54 /** |
51 * Make a checker with a minimum value. | 55 * Make a checker with a minimum value. |
52 * | 56 * |
53 * The minimum value is included in the allowed range. | 57 * The minimum value is included in the allowed range. |
54 * | 58 * |
55 * \param [in] min The minimum value. | 59 * \param [in] min The minimum value. |
(...skipping 22 matching lines...) Expand all Loading... |
78 /*************************************************************** | 82 /*************************************************************** |
79 * Implementation of the templates declared above. | 83 * Implementation of the templates declared above. |
80 ***************************************************************/ | 84 ***************************************************************/ |
81 | 85 |
82 #include "type-name.h" | 86 #include "type-name.h" |
83 | 87 |
84 namespace ns3 { | 88 namespace ns3 { |
85 | 89 |
86 namespace internal { | 90 namespace internal { |
87 | 91 |
88 Ptr<const AttributeChecker> MakeIntegerChecker (int64_t min, int64_t max, std::s
tring name); | 92 NS3_EXPORT Ptr<const AttributeChecker> MakeIntegerChecker (int64_t min, int64_t
max, std::string name); |
89 | 93 |
90 } // internal | 94 } // internal |
91 | 95 |
92 template <typename T> | 96 template <typename T> |
93 Ptr<const AttributeChecker> | 97 Ptr<const AttributeChecker> |
94 MakeIntegerChecker (int64_t min, int64_t max) | 98 MakeIntegerChecker (int64_t min, int64_t max) |
95 { | 99 { |
96 return internal::MakeIntegerChecker (min, | 100 return internal::MakeIntegerChecker (min, |
97 max, TypeNameGet<T> ()); | 101 max, TypeNameGet<T> ()); |
98 } | 102 } |
(...skipping 12 matching lines...) Expand all Loading... |
111 MakeIntegerChecker (void) | 115 MakeIntegerChecker (void) |
112 { | 116 { |
113 return internal::MakeIntegerChecker (std::numeric_limits<T>::min (), | 117 return internal::MakeIntegerChecker (std::numeric_limits<T>::min (), |
114 std::numeric_limits<T>::max (), | 118 std::numeric_limits<T>::max (), |
115 TypeNameGet<T> ()); | 119 TypeNameGet<T> ()); |
116 } | 120 } |
117 | 121 |
118 } // namespace ns3 | 122 } // namespace ns3 |
119 | 123 |
120 #endif /* INTEGER_H */ | 124 #endif /* INTEGER_H */ |
OLD | NEW |