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"

Public Member Functions

 Quantity (double value, Length::Unit unit)
 Constructor. More...
 
 Quantity (const Quantity &)=default
 Copy Constructor. More...
 
 Quantity (Quantity &&)=default
 Move Constructor. More...
 
 ~Quantity ()=default
 Destructor. More...
 
Quantityoperator= (const Quantity &)=default
 Copy Assignment Operator. More...
 
Quantityoperator= (Quantity &&)=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 266 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 275 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 )
default

Copy Assignment Operator.

◆ operator=() [2/2]

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

Move Assignment Operator.

◆ Unit()

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

The unit of the quantity.

Returns
The unit of this quantity

Definition at line 320 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 310 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 327 of file length.h.

Referenced by Unit().

◆ m_value

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

Value of the length.

Definition at line 326 of file length.h.

Referenced by Value().


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