src/core/uinteger.h
author Tom Henderson <tomh@tomh.org>
Thu, 29 May 2008 23:24:10 -0700
changeset 3182 61fe7fe81ebd
parent 2968 d6b2d00acab2
child 3365 6409d2460601
permissions -rw-r--r--
Doxygen organization
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2581
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     2
/*
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     3
 * Copyright (c) 2008 INRIA
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     4
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     7
 * published by the Free Software Foundation;
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     8
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    12
 * GNU General Public License for more details.
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    13
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    14
 * You should have received a copy of the GNU General Public License
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    15
 * along with this program; if not, write to the Free Software
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    17
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    18
 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2485
diff changeset
    19
 */
2439
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    20
#ifndef UINTEGER_H
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    21
#define UINTEGER_H
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
2438
e2ac9f9aeeb9 value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2437
diff changeset
    23
#include "attribute.h"
2451
8979f07befd5 value-helper.h -> attribute-helper.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2439
diff changeset
    24
#include "attribute-helper.h"
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include <stdint.h>
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
namespace ns3 {
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
2584
5011c132ed6c doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    29
/**
3182
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2968
diff changeset
    30
 * \ingroup attribute
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2968
diff changeset
    31
 *
2968
d6b2d00acab2 add doxygen class definitions for native type Value classes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
    32
 * \class ns3::UintegerValue
2584
5011c132ed6c doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    33
 * \brief Hold an unsigned integer type
5011c132ed6c doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    34
 *
2928
554e10cdc747 add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2599
diff changeset
    35
 * \anchor uint8_t
554e10cdc747 add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2599
diff changeset
    36
 * \anchor uint16_t
554e10cdc747 add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2599
diff changeset
    37
 * \anchor uint32_t
554e10cdc747 add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2599
diff changeset
    38
 * \anchor uint64_t
554e10cdc747 add doxygen anchors to avoid warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2599
diff changeset
    39
 *
2584
5011c132ed6c doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    40
 * This class can be used to hold variables of unsigned integer
5011c132ed6c doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    41
 * type such as uint8_t, uint16_t, uint32_t, uint64_t, or,
5011c132ed6c doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    42
 * unsigned int, etc.
5011c132ed6c doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    43
 */
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2928
diff changeset
    45
ATTRIBUTE_VALUE_DEFINE_WITH_NAME (uint64_t, Uinteger);
2439
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    46
ATTRIBUTE_ACCESSOR_DEFINE (Uinteger);
2427
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
    47
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
    48
template <typename T>
2439
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    49
Ptr<const AttributeChecker> MakeUintegerChecker (void);
2428
9c8d27c408db move checker creation function to .cc file.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2427
diff changeset
    50
2485
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    51
template <typename T>
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    52
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min);
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    53
2599
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    54
template <typename T>
2439
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    55
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max);
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
} // namespace ns3
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
2599
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    59
#include "type-name.h"
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    60
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
namespace ns3 {
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    62
2599
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    63
namespace internal {
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    64
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    65
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max, std::string name);
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    66
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    67
} // namespace internal
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    68
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    69
2439
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    70
template <typename T>
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    71
Ptr<const AttributeChecker> MakeUintegerChecker (void)
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    72
{
2599
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    73
  return internal::MakeUintegerChecker (std::numeric_limits<T>::min (),
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    74
                                        std::numeric_limits<T>::max (),
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    75
                                        TypeNameGet<T> ());
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    76
}
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    77
2485
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    78
template <typename T>
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    79
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min)
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    80
{
2599
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    81
  return internal::MakeUintegerChecker (min,
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    82
                                        std::numeric_limits<T>::max (),
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    83
                                        TypeNameGet<T> ());
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    84
}
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    85
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    86
template <typename T>
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    87
Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max)
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    88
{
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    89
  return internal::MakeUintegerChecker (min,
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    90
                                        max, 
fcc1728eb669 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2584
diff changeset
    91
                                        TypeNameGet<T> ());
2485
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    92
}
1590feefbf20 add extra checker construction function
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2455
diff changeset
    93
2379
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    94
} // namespace ns3
db1eb36bfaa4 forgot to add new files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    95
2439
4a0b22a3f5fa UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2438
diff changeset
    96
#endif /* UINTEGER_H */