27 #ifdef HAVE_BOOST_UNITS 28 #include <boost/units/quantity.hpp> 29 #include <boost/units/systems/si.hpp> 355 static std::tuple<bool, Length>
TryParse (
double value,
const std::string& unit);
373 Length (
const std::string& text);
387 Length (
double value,
const std::string& unit);
407 #ifdef HAVE_BOOST_UNITS 420 template <
class U,
class T>
421 explicit Length (boost::units::quantity<U, T> quantity);
669 std::tuple<bool, Length::Unit>
FromString (std::string unitString);
1076 #ifdef HAVE_BOOST_UNITS 1077 template <
class U,
class T>
1081 namespace bu = boost::units;
1082 using BoostMeters = bu::quantity<bu::si::length, double>;
1085 m_value =
static_cast<BoostMeters
> (quantity).value ();
Quantity(double value, Length::Unit unit)
Constructor.
Quantity As(Unit unit) const
Create a Quantity in a specific unit from a Length.
Length KiloMeters(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
bool IsLessOrEqual(const Length &other, double tolerance=DEFAULT_TOLERANCE) const
Check if other is greater or equal in value than this instance.
Length Feet(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
int64x64_t operator+(const int64x64_t &lhs)
Unary plus operator.
std::string ToSymbol(Length::Unit unit)
This function provides a string parsing method that does not rely on istream, which has been found to...
Length CentiMeters(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
int64x64_t operator-(const int64x64_t &lhs)
Unary negation operator (change sign operator).
Quantity & operator=(const Quantity &)=default
Copy Assignment Operator.
~Length()=default
Destructor.
double m_value
Length in meters.
double GetDouble() const
Current length value
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
Length NanoMeters(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
bool operator<(const EventId &a, const EventId &b)
Unit
Units of length in various measurement systems that are supported by the Length class.
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
Length 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...
Base length unit in US customary system.
static constexpr double DEFAULT_TOLERANCE
Default tolerance value used for the member comparison functions (IsEqual, IsLess, etc.)
Length NauticalMiles(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
Length Yards(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
int64_t 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...
Base length unit in metric system.
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
Length()
Default Constructor.
Length MilliMeters(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Length & operator=(const Length &other)=default
Copy Assignment operator.
bool IsGreaterOrEqual(const Length &other, double tolerance=DEFAULT_TOLERANCE) const
Check if other is equal or less in value than this instance.
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void swap(Length &other)
Swap values with another object
bool IsNotEqual(const Length &other, double tolerance=DEFAULT_TOLERANCE) const
Check if other is not equal in value to this instance.
bool IsGreater(const Length &other, double tolerance=DEFAULT_TOLERANCE) const
Check if other is less in value than this instance.
bool IsLess(const Length &other, double tolerance=DEFAULT_TOLERANCE) const
Check if other is greater in value than this instance.
~Quantity()=default
Destructor.
static std::tuple< bool, Length > TryParse(double value, const std::string &unit)
Attempt to construct a Length object from a value and a unit string.
bool IsEqual(const Length &other, double tolerance=DEFAULT_TOLERANCE) const
Check if other is equal in value to this instance.
Length Inches(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
Attribute helper (ATTRIBUTE_ )macros definition.
An immutable class which represents a value in a specific length unit.
Length::Unit m_unit
unit of length of the value
std::tuple< bool, Length::Unit > FromString(std::string unitString)
This function provides a string parsing method that does not rely on istream, which has been found to...
Length MicroMeters(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
double Value() const
The value of the quantity.
Length::Unit Unit() const
The unit of the quantity.
bool operator>(const int64x64_t &lhs, const int64x64_t &rhs)
Greater operator.
bool operator==(const EventId &a, const EventId &b)
Length Miles(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
Represents a length in meters
std::string ToName(Length::Unit unit, bool plural)
This function provides a string parsing method that does not rely on istream, which has been found to...
Length Meters(double value)
This function provides a string parsing method that does not rely on istream, which has been found to...
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
double m_value
Value of the length.