A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
core
model
integer.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 INTEGER_H
21
#define INTEGER_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 IntegerValue:
44
ATTRIBUTE_VALUE_DEFINE_WITH_NAME
(int64_t, Integer);
45
ATTRIBUTE_ACCESSOR_DEFINE
(Integer);
46
47
template
<
typename
T>
48
Ptr<const AttributeChecker>
MakeIntegerChecker
(
void
);
49
59
template
<
typename
T>
60
Ptr<const AttributeChecker>
MakeIntegerChecker
(int64_t
min
);
61
72
template
<
typename
T>
73
Ptr<const AttributeChecker>
MakeIntegerChecker
(int64_t
min
, int64_t
max
);
74
75
}
// namespace ns3
76
77
78
/***************************************************************
79
* Implementation of the templates declared above.
80
***************************************************************/
81
82
#include "
type-name.h
"
83
84
namespace
ns3
{
85
86
namespace
internal {
87
88
Ptr<const AttributeChecker>
MakeIntegerChecker
(int64_t
min
, int64_t
max
, std::string name);
89
90
}
// internal
91
92
template
<
typename
T>
93
Ptr<const AttributeChecker>
94
MakeIntegerChecker
(int64_t
min
, int64_t
max
)
95
{
96
return
internal::MakeIntegerChecker
(
min
,
97
max
, TypeNameGet<T> ());
98
}
99
100
template
<
typename
T>
101
Ptr<const AttributeChecker>
102
MakeIntegerChecker
(int64_t
min
)
103
{
104
return
internal::MakeIntegerChecker
(
min
,
105
std::numeric_limits<T>::max
(),
106
TypeNameGet<T> ());
107
}
108
109
template
<
typename
T>
110
Ptr<const AttributeChecker>
111
MakeIntegerChecker
(
void
)
112
{
113
return
internal::MakeIntegerChecker
(
std::numeric_limits<T>::min
(),
114
std::numeric_limits<T>::max
(),
115
TypeNameGet<T> ());
116
}
117
118
}
// namespace ns3
119
120
#endif
/* INTEGER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
min
#define min(a, b)
Definition:
80211b.c:42
type-name.h
ns3::TypeNameGet() function declarations.
max
#define max(a, b)
Definition:
80211b.c:43
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::MakeIntegerChecker
Ptr< const AttributeChecker > MakeIntegerChecker(void)
Definition:
integer.h:111
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::internal::MakeIntegerChecker
Ptr< const AttributeChecker > MakeIntegerChecker(int64_t min, int64_t max, std::string name)
Make an Integer attribute checker with embedded numeric type name.
Definition:
integer.cc:49
attribute-helper.h
Attribute helper (ATTRIBUTE_ )macros definition.
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Definition:
attribute-helper.h:155
ATTRIBUTE_VALUE_DEFINE_WITH_NAME
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type, name)
Declare the attribute value class nameValue for underlying class type.
Definition:
attribute-helper.h:184
Generated on Wed Nov 7 2018 10:01:49 for ns-3 by
1.8.14