58 IntegerChecker(int64_t minValue, int64_t maxValue, std::string name)
59 : m_minValue(minValue),
68 const auto v =
dynamic_cast<const IntegerValue*
>(&value);
73 return v->
Get() >= m_minValue && v->Get() <= m_maxValue;
76 std::string GetValueTypeName()
const override
79 return "ns3::IntegerValue";
82 bool HasUnderlyingTypeInformation()
const override
88 std::string GetUnderlyingTypeInformation()
const override
91 std::ostringstream oss;
92 oss << m_name <<
" " << m_minValue <<
":" << m_maxValue;
99 return ns3::Create<IntegerValue>();
105 const auto source =
dynamic_cast<const IntegerValue*
>(&src);
107 if (source ==
nullptr || destination ==
nullptr)
111 *destination = *source;
118 }* checker =
new IntegerChecker(
min,
max, name);
Represent the type of an attribute.
Hold a value for an Attribute.
Hold a signed integer type.
Smart pointer class similar to boost::intrusive_ptr.
NS_FATAL_x macro definitions.
#define ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type, name)
Define the class methods belonging to the attribute value class nameValue of the underlying class typ...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
ns3::IntegerValue attribute value declarations and template implementations.
Ptr< const AttributeChecker > MakeIntegerChecker(int64_t min, int64_t max, std::string name)
Make an Integer attribute checker with embedded numeric type name.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T > Copy(Ptr< T > object)
Return a deep copy of a Ptr.