WSF
usmtf::NamedLocation Class Reference

#include <NamedLocation.hpp>

Inheritance diagram for usmtf::NamedLocation:
Collaboration diagram for usmtf::NamedLocation:

Public Member Functions

 NamedLocation ()=default
bool ParseAndValidate (const Field &aField) override
const std::string & GetLocation () const noexcept
bool IsLocationFreeForm () const noexcept
Public Member Functions inherited from usmtf::LatLon
 LatLon ()=default
const std::string & GetLatDegree () const noexcept
const std::string & GetLonDegree () const noexcept
const std::string & GetLatSeconds () const noexcept
const std::string & GetLonSeconds () const noexcept
const std::string & GetLatMinutes () const noexcept
const std::string & GetLonMinutes () const noexcept
const std::string & GetLatHemisphere () const noexcept
const std::string & GetLonHemisphere () const noexcept
const UtLLPos & GetUtLLPos () const noexcept
std::string GetFormattedLatLon () const noexcept
Public Member Functions inherited from usmtf::FFIRN_Validator
 FFIRN_Validator ()=default
const std::string & GetRawContent () const noexcept
 Return the content of the field as it was in the USMTF set.
std::vector< std::string > SplitOnDelimeter (const std::string &value, const std::string &delimeter)
 Values separated by delimeter.
const std::string & GetFieldContent () const noexcept
Public Member Functions inherited from usmtf::Validatable
bool IsValid () const noexcept
Public Member Functions inherited from usmtf::ErrorManager
virtual ~ErrorManager ()=default
bool HasErrors () const noexcept
void LogErrors (std::ostream &aOut) const noexcept
const std::vector< ValidationError > & GetErrors () const

Protected Attributes

ICAO_Resolver mICAOService
std::string mLocation
bool mIsFreeForm
Protected Attributes inherited from usmtf::LatLon
std::string mLattitudinalDegree
std::string mLongitudinalDegree
std::string mLatMinutes
std::string mLonMinutes
std::string mLatSeconds
std::string mLonSeconds
std::string mLatHemisphere
std::string mLonHemisphere
UtLLPos mUtLLPos
Protected Attributes inherited from usmtf::FFIRN_Validator
Field mField

Additional Inherited Members

Public Types inherited from usmtf::FFIRN_Validator
using FFIRN_Func = std::function<bool(void)>
using FFIRN_DescriptorMap = std::unordered_map<std::string, FFIRN_Func>
Static Public Member Functions inherited from usmtf::LatLon
static std::string GetFormattedLatLon (const UtLLPos &position) noexcept
Static Public Member Functions inherited from usmtf::FFIRN_Validator
static bool IsInSelection (const std::string &aValue, const std::vector< std::string > &choices) noexcept
static bool IsStringLength (const std::string &aValue, size_t aLength) noexcept
static size_t CheckForAnyDelimeter (const std::string &aValue, const std::vector< std::string > &aDelimeters) noexcept
 Returns the positions of a specified delimiter if present, npos if not.
static size_t CheckForAnyDelimeter (const std::string &aValue, const std::vector< std::string > &aDelimeters, std::string &aFoundDelimeter) noexcept
template<class T>
static bool IsInRange (T aValue, T aLowerBound, T aUpperBound) noexcept
Protected Member Functions inherited from usmtf::LatLon
void SetUtLLPos () noexcept
bool IsValidLatLonMinutes () noexcept
bool IsValidLatLonSeconds () noexcept
bool IsValidLattitudinalDegree (const std::string &aValue) noexcept
bool IsValidLongitudinalDegree (const std::string &aValue) noexcept
bool IsValidMinuteOrSecond (const std::string &aValue) noexcept
bool IsValidLattitudinalHemisphere (const std::string &aValue) noexcept
bool IsValidLongitudinalHemisphere (const std::string &aValue) noexcept
Protected Member Functions inherited from usmtf::FFIRN_Validator
bool ValidateByDescriptor (const FFIRN_DescriptorMap &aDescriptorMap)
 Speed up validation if descriptor is present. Runs all functions if it isn't.
void ClearErrorsIfValid (bool aHasAtLeastOnePassed) noexcept
void SetField (const Field &aField) noexcept
 Field Setter for internal use only.
Protected Member Functions inherited from usmtf::ErrorManager
void AddError (const ValidationError &aError) noexcept
void AddError (const std::string &aFailureReason, const std::string &aValueValidatied, const std::string &aOptionalSuggestion="") noexcept
void AddError (const std::string &aErrorMessage) noexcept
void AddErrors (const std::vector< ValidationError > &aErrors) noexcept
void ClearErrors () noexcept

Detailed Description

FFIRN_Validator responsible for the validation and property extraction of a NamedLocation. It comes in several forms.

USMTF Excerpt: A.Geographic Location, LAT / LONG, MINUTES/Seconds // this is delegated to base LatLon B. Place Name, a literal string where meaning must be provided by user C. ICAO BASE CODE, A known value with a known spherical location.

Constructor & Destructor Documentation

◆ NamedLocation()

usmtf::NamedLocation::NamedLocation ( )
default

Member Function Documentation

◆ GetLocation()

const std::string & usmtf::NamedLocation::GetLocation ( ) const
noexcept

References mLocation.

Referenced by NamedLocation().

◆ IsLocationFreeForm()

bool usmtf::NamedLocation::IsLocationFreeForm ( ) const
noexcept

References mIsFreeForm.

Referenced by NamedLocation().

◆ ParseAndValidate()

bool usmtf::NamedLocation::ParseAndValidate ( const Field & aField)
overridevirtual

I am not a huge fan of violating command query separation. But, in this case it makes sense. The functions that come into ParseAndValidate have to parse to get value of the component, sometimes there are many components in a single field. Unfortunately parsing is an intertwined attribute of validation. You cant parse according to some rule set if the field is invalid, making it impossible to separate the two notions easily. I have opted to instead name the functions for what they are actually doing. Parsing components and validating them as well. Optionally members can be set within the function as well.

Reimplemented from usmtf::LatLon.

References usmtf::Field::GetContent(), usmtf::LatLon::GetFormattedLatLon(), mICAOService, mIsFreeForm, mLocation, and usmtf::LatLon::ParseAndValidate().

Referenced by NamedLocation().

Member Data Documentation

◆ mICAOService

ICAO_Resolver usmtf::NamedLocation::mICAOService
protected

Referenced by ParseAndValidate().

◆ mIsFreeForm

bool usmtf::NamedLocation::mIsFreeForm
protected

◆ mLocation

std::string usmtf::NamedLocation::mLocation
protected

Referenced by GetLocation(), and ParseAndValidate().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved