6#include "roo_logging.h"
9#if defined(ESP32) || defined(ESP8266) || defined(__linux__)
23 Area() : area_(std::nanf(
"")) {}
32 float inAres()
const {
return area_ * 0.01f; }
50 float inAcres()
const {
return area_ * 0.000247105f; }
56 bool isUnknown()
const {
return std::isnan(area_); }
90#if defined(ESP32) || defined(ESP8266) || defined(__linux__)
92 std::string asString()
const;
96 String asArduinoString()
const;
104 explicit Area(
float area) : area_(area) {}
207roo_logging::Stream &
operator<<(roo_logging::Stream &os,
const Area &val);
Representation of area, internally stored as floating-point square meters.
float inSquareMillimeters() const
Returns the area in square millimeters.
bool operator<=(const Area &other) const
float inSquareCentimeters() const
Returns the area in square centimeters.
float inHectares() const
Returns the area in hectares.
bool operator<(const Area &other) const
bool operator>(const Area &other) const
Area & operator-=(const Area &other)
float inAcres() const
Returns the area in acres.
friend Area UnknownArea()
Returns a area object representing an unknown area.
float inAres() const
Returns the area in ares.
bool isUnknown() const
Returns whether the object represents an unknown area.
Area & operator+=(const Area &other)
Area & operator*=(float multi)
bool operator>=(const Area &other) const
Area()
Creates a area object representing an 'unknown' area.
float inSquareKilometers() const
Returns the area in square kilometers.
float inSquareMeters() const
Returns the area in square meters.
Area & operator/=(float div)
friend Area AreaInSquareMeters(float)
Returns a area object equivalent to the specified area expressed in square meters.
bool operator==(const Area &other) const
bool operator!=(const Area &other) const
float inSquareInches() const
Returns the area in square inches.
float inSquareDecimeters() const
Returns the area in square decimeters.
float inSquareMicrometers() const
Returns the area in square micrometers.
Representation of length, internally stored as floating-point meters.
float inMeters() const
Returns the length in meters.
For convenience conversion from roo_time::Duration.
Length LengthInMeters(float length)
Returns a length object equivalent to the specified length expressed in meters.
Area AreaInSquareMillimeters(float area)
Returns a area object equivalent to the specified area expressed in square millimeters.
roo_logging::Stream & operator<<(roo_logging::Stream &os, const Area &val)
Area AreaInSquareCentimeters(float area)
Returns a area object equivalent to the specified area expressed in square centimeters.
Area AreaInHectares(float area)
Returns a area object equivalent to the specified area expressed in hectares.
Area AreaInSquareMeters(float area)
Returns a area object equivalent to the specified area expressed in square meters.
Area UnknownArea()
Returns a area object representing an unknown area.
Area AreaInSquareKilometers(float area)
Returns a area object equivalent to the specified area expressed in square kilometers.
Area operator+(Area a, Area b)
Area AreaInSquareDecimeters(float area)
Returns a area object equivalent to the specified area expressed in square decimeters.
Area AreaInAcres(float area)
Returns a area object equivalent to the specified area expressed in acres.
Area operator-(Area a, Area b)
Area AreaInSquareMicrometers(float area)
Returns a area object equivalent to the specified area expressed in square micrometers.
Area AreaInSquareInches(float area)
Returns a area object equivalent to the specified area expressed in acres.
Area AreaInAres(float area)
Returns a area object equivalent to the specified area expressed in ares.
Area operator/(Area a, float b)
Area operator*(Area a, float b)