A Discrete-Event Network Simulator
API
Length

Management of lengths in real world units. More...

+ Collaboration diagram for Length:

Files

file  length-example.cc
 Demonstrates usage of the ns3::Length class.
 
file  length-test-suite.cc
 Length class test suite.
 
file  length.cc
 ns3::Length implementation
 
file  length.h
 Declaration of ns3::Length class.
 

Namespaces

 anonymous_namespace{length.cc}
 Unnamed namespace.
 

Classes

class  ns3::Length
 

Represents a length in meters More...
 
bool ns3::operator== (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
bool ns3::operator!= (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
bool ns3::operator< (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
bool ns3::operator<= (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
bool ns3::operator> (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
bool ns3::operator>= (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::operator+ (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::operator- (const Length &left, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::operator* (const Length &left, double scalar)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::operator* (double scalar, const Length &right)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::operator/ (const Length &left, double scalar)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
double ns3::operator/ (const Length &numerator, const Length &denominator)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
int64_t ns3::Div (const Length &numerator, const Length &denominator, Length *remainder)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::Mod (const Length &numerator, const Length &denominator)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::string ns3::ToSymbol (Length::Unit unit)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::string ns3::ToName (Length::Unit unit, bool plural)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::tuple< bool, Length::Unitns3::FromString (std::string unitString)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::ostream & ns3::operator<< (std::ostream &stream, const Length &l)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::ostream & ns3::operator<< (std::ostream &stream, const Length::Quantity &q)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::ostream & ns3::operator<< (std::ostream &stream, Length::Unit unit)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::tuple< bool, double, std::string > ns3::ParseLengthString (const std::string &input)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
std::istream & ns3::operator>> (std::istream &stream, Length &l)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::NanoMeters (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::MicroMeters (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::MilliMeters (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::CentiMeters (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::Meters (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::KiloMeters (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::NauticalMiles (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::Inches (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::Feet (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::Yards (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length ns3::Miles (double value)
 This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations. More...
 
Length NanoMeters (double value)
 Construct a Length from nanometers. More...
 
Length MicroMeters (double value)
 Construct a Length from micrometers. More...
 
Length MilliMeters (double value)
 Construct a Length from millimeters. More...
 
Length CentiMeters (double value)
 Construct a Length from centimeters. More...
 
Length Meters (double value)
 Construct a Length from meters. More...
 
Length KiloMeters (double value)
 Construct a Length from kilometers. More...
 
Length NauticalMiles (double value)
 Construct a Length from nautical miles. More...
 
Length Inches (double value)
 Construct a Length from inches. More...
 
Length Feet (double value)
 Construct a Length from feet. More...
 
Length Yards (double value)
 Construct a Length from yards. More...
 
Length Miles (double value)
 Construct a Length from miles. More...
 

Detailed Description

Management of lengths in real world units.

Function Documentation

◆ CentiMeters() [1/2]

Length ns3::CentiMeters ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 814 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ CentiMeters() [2/2]

Length CentiMeters ( double  value)
related

Construct a Length from centimeters.

Parameters
valueValue in centimeters
Returns
Length object constructed using Length::Unit::Centimeter

Definition at line 814 of file length.cc.

◆ Div()

int64_t ns3::Div ( const Length numerator,
const Length denominator,
Length remainder 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 488 of file length.cc.

References ns3::Length::GetDouble(), and NS_FATAL_ERROR.

Referenced by DivAndMod(), TimeSimpleTestCase::DoTimeOperations(), LengthTestCase::TestDivReturnsCorrectRemainder(), LengthTestCase::TestDivReturnsCorrectResult(), and LengthTestCase::TestDivReturnsZeroRemainder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Feet() [1/2]

Length ns3::Feet ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 844 of file length.cc.

Referenced by DivAndMod(), and LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ Feet() [2/2]

Length Feet ( double  value)
related

Construct a Length from feet.

Parameters
valueValue in feet
Returns
Length object constructed using Length::Unit::Foot

Definition at line 844 of file length.cc.

◆ FromString()

std::tuple<bool, Length::Unit> ns3::FromString ( std::string  unitString)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 586 of file length.cc.

◆ Inches() [1/2]

Length ns3::Inches ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 838 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ Inches() [2/2]

Length Inches ( double  value)
related

Construct a Length from inches.

Parameters
valueValue in inches
Returns
Length object constructed using Length::Unit::Inch

Definition at line 838 of file length.cc.

◆ KiloMeters() [1/2]

Length ns3::KiloMeters ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 826 of file length.cc.

Referenced by LengthValueTestCase::TestAttributeConstructor(), LengthValueTestCase::TestAttributeDeserialization(), LengthValueTestCase::TestAttributeSerialization(), and LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ KiloMeters() [2/2]

Length KiloMeters ( double  value)
related

Construct a Length from kilometers.

Parameters
valueValue in kilometers
Returns
Length object constructed using Length::Unit::Kilometer

Definition at line 826 of file length.cc.

◆ Meters() [1/2]

Length ns3::Meters ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 820 of file length.cc.

Referenced by ArithmeticOperators(), EqualityOperators(), and LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ Meters() [2/2]

Length Meters ( double  value)
related

Construct a Length from meters.

Parameters
valueValue in meters
Returns
Length object constructed using Length::Unit::Meter

Definition at line 820 of file length.cc.

◆ MicroMeters() [1/2]

Length ns3::MicroMeters ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 802 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ MicroMeters() [2/2]

Length MicroMeters ( double  value)
related

Construct a Length from micrometers.

Parameters
valueValue in micrometers
Returns
Length object constructed using Length::Unit::Micrometer

Definition at line 802 of file length.cc.

◆ Miles() [1/2]

Length ns3::Miles ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 856 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ Miles() [2/2]

Length Miles ( double  value)
related

Construct a Length from miles.

Parameters
valueValue in miles
Returns
Length object constructed using Length::Unit::Mile

Definition at line 856 of file length.cc.

◆ MilliMeters() [1/2]

Length ns3::MilliMeters ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 808 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ MilliMeters() [2/2]

Length MilliMeters ( double  value)
related

Construct a Length from millimeters.

Parameters
valueValue in millimeters
Returns
Length object constructed using Length::Unit::Millimeter

Definition at line 808 of file length.cc.

◆ Mod()

Length ns3::Mod ( const Length numerator,
const Length denominator 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 507 of file length.cc.

References ns3::Length::GetDouble(), and NS_FATAL_ERROR.

Referenced by DivAndMod(), LengthTestCase::TestModReturnsNonZero(), and LengthTestCase::TestModReturnsZero().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NanoMeters() [1/2]

Length ns3::NanoMeters ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 796 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ NanoMeters() [2/2]

Length NanoMeters ( double  value)
related

Construct a Length from nanometers.

Parameters
valueValue in nanometers
Returns
Length object constructed using Length::Unit::Nanometer

Definition at line 796 of file length.cc.

◆ NauticalMiles() [1/2]

Length ns3::NauticalMiles ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 832 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ NauticalMiles() [2/2]

Length NauticalMiles ( double  value)
related

Construct a Length from nautical miles.

Parameters
valueValue in nautical miles
Returns
Length object constructed using Length::Unit::NauticalMile

Definition at line 832 of file length.cc.

◆ operator!=()

bool ns3::operator!= ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 409 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator*() [1/2]

Length ns3::operator* ( const Length left,
double  scalar 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 453 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator*() [2/2]

Length ns3::operator* ( double  scalar,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 460 of file length.cc.

◆ operator+()

Length ns3::operator+ ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 439 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator-()

Length ns3::operator- ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 446 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator/() [1/2]

Length ns3::operator/ ( const Length left,
double  scalar 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 466 of file length.cc.

References NS_FATAL_ERROR.

◆ operator/() [2/2]

double ns3::operator/ ( const Length numerator,
const Length denominator 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 477 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator<()

bool ns3::operator< ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 415 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator<<() [1/3]

std::ostream& ns3::operator<< ( std::ostream &  stream,
const Length l 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 675 of file length.cc.

References ns3::Length::As().

+ Here is the call graph for this function:

◆ operator<<() [2/3]

std::ostream& ns3::operator<< ( std::ostream &  stream,
const Length::Quantity q 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 683 of file length.cc.

References ns3::ToSymbol(), ns3::Length::Quantity::Unit(), and ns3::Length::Quantity::Value().

+ Here is the call graph for this function:

◆ operator<<() [3/3]

std::ostream& ns3::operator<< ( std::ostream &  stream,
Length::Unit  unit 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 691 of file length.cc.

References ns3::ToName().

+ Here is the call graph for this function:

◆ operator<=()

bool ns3::operator<= ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 421 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator==()

bool ns3::operator== ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 403 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator>()

bool ns3::operator> ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 427 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator>=()

bool ns3::operator>= ( const Length left,
const Length right 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 433 of file length.cc.

References ns3::Length::GetDouble().

+ Here is the call graph for this function:

◆ operator>>()

std::istream& ns3::operator>> ( std::istream &  stream,
Length l 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 750 of file length.cc.

References NS_LOG_LOGIC, ns3::ParseLengthString(), and ns3::Length::swap().

+ Here is the call graph for this function:

◆ ParseLengthString()

std::tuple<bool, double, std::string> ns3::ParseLengthString ( const std::string &  input)

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 715 of file length.cc.

References NS_LOG_ERROR, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::operator>>().

+ Here is the caller graph for this function:

◆ ToName()

std::string ns3::ToName ( Length::Unit  unit,
bool  plural 
)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 550 of file length.cc.

References NS_FATAL_ERROR.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ ToSymbol()

std::string ns3::ToSymbol ( Length::Unit  unit)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 520 of file length.cc.

References NS_FATAL_ERROR.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ Yards() [1/2]

Length ns3::Yards ( double  value)
related

This function provides a string parsing method that does not rely on istream, which has been found to have different behaviors in different implementations.

The input string can either contain a double (for example, "5.5") or a double and a string with no space between them (for example, "5.5m")

Parameters
inputThe input string
Returns
A three element tuple containing the result of parsing the string. The first tuple element is a boolean indicating whether the parsing succeeded or failed. The second element contains the value of the double that was extracted from the string. The third element was the unit symbol that was extracted from the string. If the input string did not have a unit symbol, the third element will contain an empty string.

Definition at line 850 of file length.cc.

Referenced by LengthTestCase::TestBuilderFreeFunctions().

+ Here is the caller graph for this function:

◆ Yards() [2/2]

Length Yards ( double  value)
related

Construct a Length from yards.

Parameters
valueValue in yards
Returns
Length object constructed using Length::Unit::Yard

Definition at line 850 of file length.cc.