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 NS_DOUBLE_H | 20 #ifndef NS_DOUBLE_H |
21 #define NS_DOUBLE_H | 21 #define NS_DOUBLE_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_Double | 34 * \ingroup attribute_Double |
31 * ns3::DoubleValue attribute value declarations and template implementations. | 35 * ns3::DoubleValue attribute value declarations and template implementations. |
32 */ | 36 */ |
33 | 37 |
34 namespace ns3 { | 38 namespace ns3 { |
35 | 39 |
36 // Additional docs for class DoubleValue: | 40 // Additional docs for class DoubleValue: |
37 /** | 41 /** |
38 * This class can be used to hold variables of floating point type | 42 * This class can be used to hold variables of floating point type |
39 * such as 'double' or 'float'. The internal format is 'double'. | 43 * such as 'double' or 'float'. The internal format is 'double'. |
40 */ | 44 */ |
41 ATTRIBUTE_VALUE_DEFINE_WITH_NAME (double, Double); | 45 ATTRIBUTE_VALUE_DEFINE_WITH_NAME_LIB (double, Double, NS3_EXPORT); |
42 ATTRIBUTE_ACCESSOR_DEFINE (Double); | 46 ATTRIBUTE_ACCESSOR_DEFINE_LIB (Double, NS3_EXPORT); |
43 | 47 |
44 template <typename T> | 48 template <typename T> |
45 Ptr<const AttributeChecker> MakeDoubleChecker (void); | 49 Ptr<const AttributeChecker> MakeDoubleChecker (void); |
46 | 50 |
47 /** | 51 /** |
48 * Make a checker with a minimum value. | 52 * Make a checker with a minimum value. |
49 * | 53 * |
50 * The minimum value is included in the allowed range. | 54 * The minimum value is included in the allowed range. |
51 * | 55 * |
52 * \param [in] min The minimum value. | 56 * \param [in] min The minimum value. |
(...skipping 23 matching lines...) Expand all Loading... |
76 /*************************************************************** | 80 /*************************************************************** |
77 * Implementation of the templates declared above. | 81 * Implementation of the templates declared above. |
78 ***************************************************************/ | 82 ***************************************************************/ |
79 | 83 |
80 #include "type-name.h" | 84 #include "type-name.h" |
81 | 85 |
82 namespace ns3 { | 86 namespace ns3 { |
83 | 87 |
84 namespace internal { | 88 namespace internal { |
85 | 89 |
86 Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max, std::stri
ng name); | 90 NS3_EXPORT Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max
, std::string name); |
87 | 91 |
88 } // namespace internal | 92 } // namespace internal |
89 | 93 |
90 template <typename T> | 94 template <typename T> |
91 Ptr<const AttributeChecker> MakeDoubleChecker (void) | 95 Ptr<const AttributeChecker> MakeDoubleChecker (void) |
92 { | 96 { |
93 return internal::MakeDoubleChecker (-std::numeric_limits<T>::max (), | 97 return internal::MakeDoubleChecker (-std::numeric_limits<T>::max (), |
94 std::numeric_limits<T>::max (), | 98 std::numeric_limits<T>::max (), |
95 TypeNameGet<T> ()); | 99 TypeNameGet<T> ()); |
96 } | 100 } |
(...skipping 10 matching lines...) Expand all Loading... |
107 Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max) | 111 Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max) |
108 { | 112 { |
109 return internal::MakeDoubleChecker (min, | 113 return internal::MakeDoubleChecker (min, |
110 max, | 114 max, |
111 TypeNameGet<T> ()); | 115 TypeNameGet<T> ()); |
112 } | 116 } |
113 | 117 |
114 } // namespace ns3 | 118 } // namespace ns3 |
115 | 119 |
116 #endif /* NS_DOUBLE_H */ | 120 #endif /* NS_DOUBLE_H */ |
OLD | NEW |