00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef INTEGER_H
00021 #define INTEGER_H
00022
00023 #include "attribute.h"
00024 #include "attribute-helper.h"
00025 #include <stdint.h>
00026 #include <limits>
00027
00028 namespace ns3 {
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 ATTRIBUTE_VALUE_DEFINE_WITH_NAME(int64_t, Integer);
00046 ATTRIBUTE_ACCESSOR_DEFINE(Integer);
00047
00048 template <typename T>
00049 Ptr<const AttributeChecker> MakeIntegerChecker (void);
00050
00051 template <typename T>
00052 Ptr<const AttributeChecker> MakeIntegerChecker (int64_t min);
00053
00054 template <typename T>
00055 Ptr<const AttributeChecker> MakeIntegerChecker (int64_t min, int64_t max);
00056
00057 }
00058
00059 #include "type-name.h"
00060
00061 namespace ns3 {
00062
00063 namespace internal {
00064
00065 Ptr<const AttributeChecker> MakeIntegerChecker (int64_t min, int64_t max, std::string name);
00066
00067 }
00068
00069 template <typename T>
00070 Ptr<const AttributeChecker>
00071 MakeIntegerChecker (int64_t min, int64_t max)
00072 {
00073 return internal::MakeIntegerChecker (min,
00074 max, TypeNameGet<T> ());
00075 }
00076
00077 template <typename T>
00078 Ptr<const AttributeChecker>
00079 MakeIntegerChecker (int64_t min)
00080 {
00081 return internal::MakeIntegerChecker (min,
00082 std::numeric_limits<T>::max (),
00083 TypeNameGet<T> ());
00084 }
00085
00086 template <typename T>
00087 Ptr<const AttributeChecker>
00088 MakeIntegerChecker (void)
00089 {
00090 return internal::MakeIntegerChecker (std::numeric_limits<T>::min (),
00091 std::numeric_limits<T>::max (),
00092 TypeNameGet<T> ());
00093 }
00094
00095 }
00096
00097 #endif