unity.scopes.Location

Holds location attributes such as latitude, longitude, etc. More...

#include <unity/scopes/Location.h>

Public Member Functions

 Location (double latitude, double longitude)
 Construct a new Location with the specified latitude and longitude. More...
 
 Location (VariantMap const &variant)
 Construct a Location from a the given serialized VariantMap.
 
double altitude () const
 Get the altitude. More...
 
bool has_altitude () const
 Is there an altitude property. More...
 
std::string area_code () const
 Get the area code. More...
 
bool has_area_code () const
 Is there an area code property. More...
 
std::string city () const
 Get the city name. More...
 
bool has_city () const
 Is there a city property. More...
 
std::string country_code () const
 Get the country code. More...
 
bool has_country_code () const
 Is there a country code property. More...
 
std::string country_name () const
 Get the country name. More...
 
bool has_country_name () const
 Is there a country name property. More...
 
double horizontal_accuracy () const
 Get the horizontal accuracy. More...
 
bool has_horizontal_accuracy () const
 Is there a horizontal accuracy property. More...
 
double latitude () const
 Get the latitude. More...
 
double longitude () const
 Get the longitude. More...
 
VariantMap serialize () const
 Return a dictionary of all location attributes. More...
 
std::string region_code () const
 Get the region code. More...
 
bool has_region_code () const
 Is there a region code property. More...
 
std::string region_name () const
 Get the region name. More...
 
bool has_region_name () const
 Is there a region name property. More...
 
double vertical_accuracy () const
 Get the vertical accuracy. More...
 
bool has_vertical_accuracy () const
 Is there a vertical accuracy property. More...
 
std::string zip_postal_code () const
 Get the zip or postal code. More...
 
bool has_zip_postal_code () const
 Is there a zip / postal code property. More...
 
void set_altitude (double altitude)
 Set the altitude. More...
 
void set_area_code (std::string const &area_code)
 Set the area code. More...
 
void set_city (std::string const &city)
 Set the city name. More...
 
void set_country_code (std::string const &country_code)
 Set the country code. More...
 
void set_country_name (std::string const &country_name)
 Set the country name. More...
 
void set_horizontal_accuracy (double horizontal_accuracy)
 Set the horizontal accuracy. More...
 
void set_latitude (double latitude)
 Set the latitude. More...
 
void set_longitude (double longitude)
 Set the longitude. More...
 
void set_region_code (std::string const &region_code)
 Set the region code. More...
 
void set_region_name (std::string const &region_name)
 Set the region name. More...
 
void set_vertical_accuracy (double vertical_accuracy)
 Set the vertical_accuracy. More...
 
void set_zip_postal_code (std::string const &zip_postal_code)
 Set the zip/postal code. More...
 
Copy and assignment

Copy and assignment operators (move and non-move versions) have the usual value semantics.

 Location (Location const &other)
 
 Location (Location &&)
 
Locationoperator= (Location const &other)
 
Locationoperator= (Location &&)
 

Detailed Description

Holds location attributes such as latitude, longitude, etc.

Constructor & Destructor Documentation

unity::scopes::Location::Location ( double  latitude,
double  longitude 
)

Construct a new Location with the specified latitude and longitude.

Parameters
latitudeLatitude
longitudeLongitude

Member Function Documentation

double unity::scopes::Location::altitude ( ) const

Get the altitude.

Returns
The altitude.
Exceptions
unity::scopes::NotFoundExceptionif altitude is not set.
std::string unity::scopes::Location::area_code ( ) const

Get the area code.

Returns
The area code.
Exceptions
unity::scopes::NotFoundExceptionif area code is not set.
std::string unity::scopes::Location::city ( ) const

Get the city name.

Returns
The city name.
Exceptions
unity::scopes::NotFoundExceptionif city is not set.
std::string unity::scopes::Location::country_code ( ) const

Get the country code.

Returns
The country code.
Exceptions
unity::scopes::NotFoundExceptionif country code is not set.
std::string unity::scopes::Location::country_name ( ) const

Get the country name.

Returns
The country name.
Exceptions
unity::scopes::NotFoundExceptionif country name is not set.
bool unity::scopes::Location::has_altitude ( ) const

Is there an altitude property.

Returns
True if there is an altitude property.
bool unity::scopes::Location::has_area_code ( ) const

Is there an area code property.

Returns
True if there is an area code property.
bool unity::scopes::Location::has_city ( ) const

Is there a city property.

Returns
True if there is a city property.
bool unity::scopes::Location::has_country_code ( ) const

Is there a country code property.

Returns
True if there is a country code property.
bool unity::scopes::Location::has_country_name ( ) const

Is there a country name property.

Returns
True if there is a country name property.
bool unity::scopes::Location::has_horizontal_accuracy ( ) const

Is there a horizontal accuracy property.

Returns
True if there is a horizontal accuracy property.
bool unity::scopes::Location::has_region_code ( ) const

Is there a region code property.

Returns
True if there is a region code property.
bool unity::scopes::Location::has_region_name ( ) const

Is there a region name property.

Returns
True if there is a region name property.
bool unity::scopes::Location::has_vertical_accuracy ( ) const

Is there a vertical accuracy property.

Returns
True if there is a vertical accuracy property.
bool unity::scopes::Location::has_zip_postal_code ( ) const

Is there a zip / postal code property.

Returns
True if there is a zip / postal code property.
double unity::scopes::Location::horizontal_accuracy ( ) const

Get the horizontal accuracy.

Returns
The horizontal accuracy.
Exceptions
unity::scopes::NotFoundExceptionif horizontal accuracy is not set.
double unity::scopes::Location::latitude ( ) const

Get the latitude.

Returns
The latitude.
double unity::scopes::Location::longitude ( ) const

Get the longitude.

Returns
The longitude.
std::string unity::scopes::Location::region_code ( ) const

Get the region code.

Returns
The region code.
Exceptions
unity::scopes::NotFoundExceptionif region code is not set.
std::string unity::scopes::Location::region_name ( ) const

Get the region name.

Returns
The region name.
Exceptions
unity::scopes::NotFoundExceptionif region name is not set.
VariantMap unity::scopes::Location::serialize ( ) const

Return a dictionary of all location attributes.

Returns
Dictionary of all location attributes.
void unity::scopes::Location::set_altitude ( double  altitude)

Set the altitude.

Parameters
altitudeIn meters.
void unity::scopes::Location::set_area_code ( std::string const &  area_code)

Set the area code.

Parameters
area_codeFIPS10-4 area code.
void unity::scopes::Location::set_city ( std::string const &  city)

Set the city name.

Parameters
cityName of the city.
void unity::scopes::Location::set_country_code ( std::string const &  country_code)

Set the country code.

Parameters
country_codeFIPS10-4 country code.
void unity::scopes::Location::set_country_name ( std::string const &  country_name)

Set the country name.

Parameters
country_nameHuman readable country name.
void unity::scopes::Location::set_horizontal_accuracy ( double  horizontal_accuracy)

Set the horizontal accuracy.

Parameters
horizontal_accuracyHorizontal accouracy.
void unity::scopes::Location::set_latitude ( double  latitude)

Set the latitude.

Parameters
latitudeLatitude.
void unity::scopes::Location::set_longitude ( double  longitude)

Set the longitude.

Parameters
longitudeLatitude.
void unity::scopes::Location::set_region_code ( std::string const &  region_code)

Set the region code.

Parameters
region_codeFIPS10-4 region code.
void unity::scopes::Location::set_region_name ( std::string const &  region_name)

Set the region name.

Parameters
region_nameHuman readable region name.
void unity::scopes::Location::set_vertical_accuracy ( double  vertical_accuracy)

Set the vertical_accuracy.

Parameters
vertical_accuracyVertical accuracy in meters.
void unity::scopes::Location::set_zip_postal_code ( std::string const &  zip_postal_code)

Set the zip/postal code.

Parameters
zip_postal_codeEither a zip or postal code.
double unity::scopes::Location::vertical_accuracy ( ) const

Get the vertical accuracy.

Returns
The vertical accuracy.
Exceptions
unity::scopes::NotFoundExceptionif vertical accuracy is not set.
std::string unity::scopes::Location::zip_postal_code ( ) const

Get the zip or postal code.

Returns
The zip or postal code.
Exceptions
unity::scopes::NotFoundExceptionif postal code is not set.