A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
 Quantity (double value, Length::Unit unit)
 Constructor.
 
 Quantity (Quantity &&)=default
 Move Constructor.
 
 ~Quantity ()=default
 Destructor.
 
Quantityoperator= (const Quantity &other)=default
 Copy Assignment Operator.
 
Quantityoperator= (Quantity &&other)=default
 Move Assignment Operator.
 
Length::Unit Unit () const
 The unit of the quantity.
 
double Value () const
 The value of the quantity.
 

Private Attributes

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

Detailed Description

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

Definition at line 260 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 269 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 319 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 309 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 326 of file length.h.

Referenced by Unit().

◆ m_value

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

Value of the length.

Definition at line 325 of file length.h.

Referenced by Value().


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