A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
double.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 INRIA
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
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
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef NS_DOUBLE_H
21 #define NS_DOUBLE_H
22 
23 #include "attribute.h"
24 #include "attribute-helper.h"
25 #include <stdint.h>
26 #include <limits>
27 
28 namespace ns3 {
29 
43 
44 template <typename T>
46 
47 template <typename T>
49 
50 template <typename T>
51 Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max);
52 
53 
54 } // namespace ns3
55 
56 #include "type-name.h"
57 
58 namespace ns3 {
59 
60 namespace internal {
61 
62 Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max, std::string name);
63 
64 } // namespace internal
65 
66 template <typename T>
68 {
69  return internal::MakeDoubleChecker (-std::numeric_limits<T>::max (),
70  std::numeric_limits<T>::max (),
71  TypeNameGet<T> ());
72 }
73 
74 template <typename T>
76 {
77  return internal::MakeDoubleChecker (min,
78  std::numeric_limits<T>::max (),
79  TypeNameGet<T> ());
80 }
81 
82 template <typename T>
84 {
85  return internal::MakeDoubleChecker (min,
86  max,
87  TypeNameGet<T> ());
88 }
89 
90 } // namespace ns3
91 
92 #endif /* NS_DOUBLE_H */
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
ATTRIBUTE_ACCESSOR_DEFINE(Boolean)
Ptr< const AttributeChecker > MakeDoubleChecker(void)
Definition: double.h:67
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type, name)
Declare the attribute value class nameValue for underlying class type.
Ptr< const AttributeChecker > MakeDoubleChecker(double min, double max, std::string name)
Definition: double.cc:33