A Discrete-Event Network Simulator Home Tutorials  ▼ Docs    ▼ Develop ▼ API
Double Attribute

Attribute implementation for Double. More...

Collaboration diagram for Double Attribute:

## Files

file  double.cc
ns3::DoubleValue attribute value implementation.

file  double.h
ns3::DoubleValue attribute value declarations and template implementations.

## Classes

class  ns3::DoubleChecker
AttributeChecker implementation for DoubleValue. More...

class  ns3::DoubleValue
This class can be used to hold variables of floating point type such as 'double' or 'float'. More...

## Functions

template<typename T1 >
Ptr< const AttributeAccessor > ns3::MakeDoubleAccessor (T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method. More...

template<typename T1 , typename T2 >
Ptr< const AttributeAccessor > ns3::MakeDoubleAccessor (T1 a1, T2 a2)
Create an AttributeAccessor using a pair of get functor and set methods from a class. More...

template<typename T >
Ptr< const AttributeChecker > ns3::MakeDoubleChecker (void)

Ptr< const AttributeChecker > ns3::internal::MakeDoubleChecker (double min, double max, std::string name)
Make a Double attribute checker with embedded numeric type name. More...

## Detailed Description

Attribute implementation for Double.

## Function Documentation

template<typename T1 >
 ns3::Ptr< const ns3::AttributeAccessor > ns3::MakeDoubleAccessor ( T1 a1 )

Create an AttributeAccessor for a class data member, or a lone class get functor or set method.

The get functor method should have a signature like

typedef U (T::*getter)(void) const

where T is the class and U is the type of the return value.

The set method should have one of these signatures:

typedef void (T::*setter)(U)
typedef bool (T::*setter)(U)

where T is the class and U is the type of the value to set the attribute to, which should be compatible with the specific AttributeValue type V which holds the value (or the type implied by the name Make<V>Accessor of this function.) In the case of a setter returning bool, the return value should be true if the value could be set successfully.

Template Parameters
 V [explicit] (If present) The specific AttributeValue type to use to represent the Attribute. (If not present, the type V is implicit in the name of this function, as "MakeAccessor" T1 [deduced] The type of the class data member, or the type of the class get functor or set method.
Parameters
 [in] a1 The address of the data member, or the get or set method.
Returns
The AttributeAccessor
AttributeAccessor

Definition at line 42 of file double.h.

template<typename T1 , typename T2 >
 ns3::Ptr< const ns3::AttributeAccessor > ns3::MakeDoubleAccessor ( T1 a1, T2 a2 )

Create an AttributeAccessor using a pair of get functor and set methods from a class.

The get functor method should have a signature like

typedef U (T::*getter)(void) const

where T is the class and U is the type of the return value.

The set method should have one of these signatures:

typedef void (T::*setter)(U)
typedef bool (T::*setter)(U)

where T is the class and U is the type of the value to set the attribute to, which should be compatible with the specific AttributeValue type V which holds the value (or the type implied by the name Make<V>Accessor of this function.) In the case of a setter returning bool, the return value should be true if the value could be set successfully.

In practice the setter and getter arguments can appear in either order, but setter first is preferred.

Template Parameters
 V [explicit] (If present) The specific AttributeValue type to use to represent the Attribute. (If not present, the type V is implicit in the name of this function as "MakeAccessor" T1 [deduced] The type of the class data member, or the type of the class get functor or set method. T2 [deduced] The type of the getter class functor method.
Parameters
 [in] a2 The address of the class method to set the attribute. [in] a1 The address of the data member, or the get or set method.
Returns
The AttributeAccessor
AttributeAccessor

Definition at line 42 of file double.h.

template<typename T >
 Ptr< const AttributeChecker > ns3::MakeDoubleChecker ( void )
Returns
The AttributeChecker.
AttributeChecker

Definition at line 91 of file double.h.

References ns3::internal::MakeDoubleChecker(), and max.

Here is the call graph for this function:

 Ptr< const AttributeChecker > ns3::internal::MakeDoubleChecker ( double min, double max, std::string name )

Make a Double attribute checker with embedded numeric type name.

Parameters
 [in] min The minimum allowed value. [in] max The maximum allowed value. [in] name The original type name ("float", "double").
Returns
The AttributeChecker.

Definition at line 49 of file double.cc.

Referenced by ns3::MakeDoubleChecker().

Here is the call graph for this function:

Here is the caller graph for this function: