59 Checker(
double minValue,
double maxValue, std::string name)
60 : m_minValue(minValue),
69 const auto v =
dynamic_cast<const DoubleValue*
>(&value);
74 return v->
Get() >= m_minValue && v->Get() <= m_maxValue;
77 std::string GetValueTypeName()
const override
80 return "ns3::DoubleValue";
83 bool HasUnderlyingTypeInformation()
const override
89 std::string GetUnderlyingTypeInformation()
const override
92 std::ostringstream oss;
93 oss << m_name <<
" " << m_minValue <<
":" << m_maxValue;
100 return ns3::Create<DoubleValue>();
106 const auto src =
dynamic_cast<const DoubleValue*
>(&source);
107 auto dst =
dynamic_cast<DoubleValue*
>(&destination);
108 if (src ==
nullptr || dst ==
nullptr)
119 }* checker =
new Checker(
min,
max, name);
Represent the type of an attribute.
Hold a value for an Attribute.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Smart pointer class similar to boost::intrusive_ptr.
ns3::DoubleValue attribute value declarations and template implementations.
#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.
void(* Double)(double oldValue, double newValue)
TracedValue Callback signature for POD.
Ptr< const AttributeChecker > MakeDoubleChecker(double min, double max, std::string name)
Make a Double 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.
ns3::Object class declaration, which is the root of the Object hierarchy and Aggregation.