A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
uinteger.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19#ifndef UINTEGER_H
20#define UINTEGER_H
21
22#include "attribute-helper.h"
23#include "attribute.h"
24
25#include <limits>
26#include <stdint.h>
27
34namespace ns3
35{
36
37// Additional docs for class UintegerValue:
47
48template <typename T>
50
60template <typename T>
62
73template <typename T>
75
76} // namespace ns3
77
78/***************************************************************
79 * Implementation of the templates declared above.
80 ***************************************************************/
81
82#include "type-name.h"
83
84namespace ns3
85{
86
87namespace internal
88{
89
90Ptr<const AttributeChecker> MakeUintegerChecker(uint64_t min, uint64_t max, std::string name);
91
92} // namespace internal
93
94template <typename T>
95Ptr<const AttributeChecker>
97{
98 return internal::MakeUintegerChecker(std::numeric_limits<T>::min(),
99 std::numeric_limits<T>::max(),
100 TypeNameGet<T>());
101}
102
103template <typename T>
104Ptr<const AttributeChecker>
106{
107 return internal::MakeUintegerChecker(min, std::numeric_limits<T>::max(), TypeNameGet<T>());
108}
109
110template <typename T>
111Ptr<const AttributeChecker>
112MakeUintegerChecker(uint64_t min, uint64_t max)
113{
114 return internal::MakeUintegerChecker(min, max, TypeNameGet<T>());
115}
116
117} // namespace ns3
118
119#endif /* UINTEGER_H */
#define min(a, b)
Definition: 80211b.c:41
#define max(a, b)
Definition: 80211b.c:42
Attribute helper (ATTRIBUTE_ )macros definition.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Ptr< const AttributeChecker > MakeUintegerChecker(uint64_t min, uint64_t max, std::string name)
Make an Uinteger attribute checker with embedded numeric type name.
Definition: uinteger.cc:52
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition: uinteger.h:96
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type, name)
Declare the attribute value class nameValue for underlying class type.
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TypeNameGet() function declarations.