A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
length.cc File Reference

ns3::Length implementation More...

#include "ns3/length.h"
#include "ns3/log.h"
#include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <functional>
#include <limits>
#include <map>
#include <ratio>
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
+ Include dependency graph for length.cc:

Go to the source code of this file.

Classes

class  anonymous_namespace{length.cc}::EnumHash
 Functor for hashing Length::Unit values. More...
 

Namespaces

namespace  anonymous_namespace{length.cc}
 Unnamed namespace.
 
namespace  ns3
 Every class exported by the ns3 library is enclosed in the ns3 namespace.
 

Functions

 ns3::ATTRIBUTE_HELPER_CPP (Length)
 
double anonymous_namespace{length.cc}::Convert (const ns3::Length::Quantity &from, ns3::Length::Unit toUnit)
 Convert a Length::Quantity to the equivalent value in another unit.
 
double anonymous_namespace{length.cc}::Convert (double value, ns3::Length::Unit fromUnit, ns3::Length::Unit toUnit)
 Convert a value in one unit to the equivalent value in another unit.
 
int64_t ns3::Div (const Length &numerator, const Length &denominator, Length *remainder=nullptr)
 Calculate how many times numerator can be split into denominator sized pieces.
 
double anonymous_namespace{length.cc}::FootToMeter (double value)
 Convert a value in feet to the equivalent value in meters.
 
std::optional< Length::Unitns3::FromString (std::string unitString)
 Find the equivalent Length::Unit for a unit string.
 
double anonymous_namespace{length.cc}::MeterToFoot (double value)
 Convert a value in meters to the equivalent value in feet.
 
template<class R >
double anonymous_namespace{length.cc}::MeterToUS (double value)
 Convert a value from meters to a US Customary unit (inches, feet, yards etc.)
 
Length ns3::Mod (const Length &numerator, const Length &denominator)
 Calculate the amount remaining after dividing two lengths.
 
bool ns3::operator!= (const Length &left, const Length &right)
 Compare two length objects for inequality.
 
Length ns3::operator* (const Length &l, double scalar)
 Multiply a length value by a scalar.
 
Length ns3::operator* (double scalar, const Length &l)
 Multiply a length value by a scalar.
 
Length ns3::operator+ (const Length &left, const Length &right)
 Add two length values together.
 
Length ns3::operator- (const Length &left, const Length &right)
 Subtract two length values.
 
Length ns3::operator/ (const Length &left, double scalar)
 Divide a length value by a scalar.
 
double ns3::operator/ (const Length &numerator, const Length &denominator)
 Divide a length value by another length value.
 
bool ns3::operator< (const Length &left, const Length &right)
 Check if left has a value less than right.
 
std::ostream & ns3::operator<< (std::ostream &stream, const Length &l)
 Write a length value to an output stream.
 
std::ostream & ns3::operator<< (std::ostream &stream, const Length::Quantity &q)
 Write a Quantity to an output stream.
 
std::ostream & ns3::operator<< (std::ostream &stream, Length::Unit unit)
 Write a Length::Unit to an output stream.
 
bool ns3::operator<= (const Length &left, const Length &right)
 Check if left has a value less than or equal to right.
 
bool ns3::operator== (const Length &left, const Length &right)
 Compare two length objects for equality.
 
bool ns3::operator> (const Length &left, const Length &right)
 Check if left has a value greater than right.
 
bool ns3::operator>= (const Length &left, const Length &right)
 Check if left has a value greater than or equal to right.
 
std::istream & ns3::operator>> (std::istream &stream, Length &l)
 Read a length value from an input stream.
 
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.
 
template<class R >
double anonymous_namespace{length.cc}::ScaleValue (double value)
 Helper function to scale an input value by a given ratio.
 
std::string ns3::ToName (Length::Unit unit, bool plural=false)
 Return the name of the supplied unit.
 
std::string ns3::ToSymbol (Length::Unit unit)
 Return the symbol of the supplied unit.
 
template<class R >
double anonymous_namespace{length.cc}::USToMeter (double value)
 Convert a value from a US Customary unit (inches, feet, yards etc.) to meters.
 
Length ns3::CentiMeters (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::Feet (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::Inches (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::KiloMeters (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::Meters (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::MicroMeters (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::Miles (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::MilliMeters (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::NanoMeters (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::NauticalMiles (double value)
 Construct a length from a value in the indicated unit.
 
Length ns3::Yards (double value)
 Construct a length from a value in the indicated unit.
 

Detailed Description

ns3::Length implementation

Definition in file length.cc.