A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
34
namespace
ns3 {
35
36
// Additional docs for class DoubleValue:
41
ATTRIBUTE_VALUE_DEFINE_WITH_NAME
(
double
,
Double
);
42
ATTRIBUTE_ACCESSOR_DEFINE
(
Double
);
43
44
template
<
typename
T>
45
Ptr<const AttributeChecker>
MakeDoubleChecker
(
void
);
46
56
template
<
typename
T>
57
Ptr<const AttributeChecker>
MakeDoubleChecker
(
double
min
);
58
69
template
<
typename
T>
70
Ptr<const AttributeChecker>
MakeDoubleChecker
(
double
min
,
double
max
);
71
72
73
}
// namespace ns3
74
75
76
/***************************************************************
77
* Implementation of the templates declared above.
78
***************************************************************/
79
80
#include "
type-name.h
"
81
82
namespace
ns3 {
83
84
namespace
internal {
85
86
Ptr<const AttributeChecker>
MakeDoubleChecker
(
double
min
,
double
max
, std::string name);
87
88
}
// namespace internal
89
90
template
<
typename
T>
91
Ptr<const AttributeChecker>
MakeDoubleChecker
(
void
)
92
{
93
return
internal::MakeDoubleChecker
(-
std::numeric_limits<T>::max
(),
94
std::numeric_limits<T>::max
(),
95
TypeNameGet<T> ());
96
}
97
98
template
<
typename
T>
99
Ptr<const AttributeChecker>
MakeDoubleChecker
(
double
min
)
100
{
101
return
internal::MakeDoubleChecker
(min,
102
std::numeric_limits<T>::max
(),
103
TypeNameGet<T> ());
104
}
105
106
template
<
typename
T>
107
Ptr<const AttributeChecker>
MakeDoubleChecker
(
double
min
,
double
max
)
108
{
109
return
internal::MakeDoubleChecker
(min,
110
max,
111
TypeNameGet<T> ());
112
}
113
114
}
// namespace ns3
115
116
#endif
/* NS_DOUBLE_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
min
#define min(a, b)
Definition:
80211b.c:44
ns3::TracedValueCallback::Double
void(* Double)(double oldValue, double newValue)
TracedValue Callback signature for POD.
Definition:
traced-value.h:89
type-name.h
ns3::TypeNameGet() function declarations.
ns3::MakeDoubleChecker
Ptr< const AttributeChecker > MakeDoubleChecker(void)
Definition:
double.h:91
max
#define max(a, b)
Definition:
80211b.c:45
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::internal::MakeDoubleChecker
Ptr< const AttributeChecker > MakeDoubleChecker(double min, double max, std::string name)
Make a Double attribute checker with embedded numeric type name.
Definition:
double.cc:49
attribute-helper.h
Declaration of Attribute helper macros.
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Definition:
attribute-helper.h:152
ATTRIBUTE_VALUE_DEFINE_WITH_NAME
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type, name)
Declare the attribute value class <name>Value for underlying class type.
Definition:
attribute-helper.h:180
src
core
model
double.h
Generated on Wed Jul 6 2016 17:11:25 for ns-3 by
1.8.6