A Discrete-Event Network Simulator
API
ns3::Length::Quantity Class Reference

An immutable class which represents a value in a specific length unit. More...

#include "length.h"

+ Collaboration diagram for ns3::Length::Quantity:

Public Member Functions

 Quantity (const Quantity &)=default
 Copy Constructor. More...
 
 Quantity (double value, Length::Unit unit)
 Constructor. More...
 
 Quantity (Quantity &&)=default
 Move Constructor. More...
 
 ~Quantity ()=default
 Destructor. More...
 
Quantityoperator= (const Quantity &other)=default
 Copy Assignment Operator. More...
 
Quantityoperator= (Quantity &&other)=default
 Move Assignment Operator. More...
 
Length::Unit Unit () const
 The unit of the quantity. More...
 
double Value () const
 The value of the quantity. More...
 

Private Attributes

Length::Unit m_unit
 unit of length of the value More...
 
double m_value
 Value of the length. More...
 

Detailed Description

An immutable class which represents a value in a specific length unit.

Definition at line 271 of file length.h.

Constructor & Destructor Documentation

◆ Quantity() [1/3]

ns3::Length::Quantity::Quantity ( double  value,
Length::Unit  unit 
)
inline

Constructor.

Parameters
valueLength value
unitLength unit of the value

Definition at line 280 of file length.h.

◆ Quantity() [2/3]

ns3::Length::Quantity::Quantity ( const Quantity )
default

Copy Constructor.

◆ Quantity() [3/3]

ns3::Length::Quantity::Quantity ( Quantity &&  )
default

Move Constructor.

◆ ~Quantity()

ns3::Length::Quantity::~Quantity ( )
default

Destructor.

Member Function Documentation

◆ operator=() [1/2]

Quantity& ns3::Length::Quantity::operator= ( const Quantity other)
default

Copy Assignment Operator.

Parameters
[in]otherThe source to copy from.
Returns
this.

◆ operator=() [2/2]

Quantity& ns3::Length::Quantity::operator= ( Quantity &&  other)
default

Move Assignment Operator.

Parameters
[in]otherThe source to move from.
Returns
this.

◆ Unit()

Length::Unit ns3::Length::Quantity::Unit ( ) const
inline

The unit of the quantity.

Returns
The unit of this quantity

Definition at line 330 of file length.h.

References m_unit.

Referenced by anonymous_namespace{length.cc}::Convert(), and ns3::operator<<().

+ Here is the caller graph for this function:

◆ Value()

double ns3::Length::Quantity::Value ( ) const
inline

The value of the quantity.

Returns
The value of this quantity

Definition at line 320 of file length.h.

References m_value.

Referenced by anonymous_namespace{length.cc}::Convert(), ns3::operator<<(), and LengthTestCase::TestConstructLengthFromQuantity().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_unit

Length::Unit ns3::Length::Quantity::m_unit
private

unit of length of the value

Definition at line 337 of file length.h.

Referenced by Unit().

◆ m_value

double ns3::Length::Quantity::m_value
private

Value of the length.

Definition at line 336 of file length.h.

Referenced by Value().


The documentation for this class was generated from the following file: