WSF
usmtf::LatLon Class Reference

B.POSITION OR ROUTE POINT, LAT / LONG, SECONDS. More...

#include <LatLon.hpp>

Inheritance diagram for usmtf::LatLon:
Collaboration diagram for usmtf::LatLon:

Public Member Functions

 LatLon ()=default
bool ParseAndValidate (const Field &aField) override
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

Static Public Member Functions

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

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

Protected Attributes

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>

Detailed Description

B.POSITION OR ROUTE POINT, LAT / LONG, SECONDS.

FFIRN_Validator responsible for the validation and property extraction of a LatLon. A LatLon is a field that indicates latitude and longitude. It comes in several forms.

USMTF Excerpt: A.POSITION OR POINT, LAT / LONG, MINUTES

LATITUDE, DEGREES 2 N ALLOWABLE ENTRIES : (00 THROUGH 90).

LATITUDE MINUTE(ANGULAR) 2 N ALLOWABLE ENTRIES : (00 THROUGH 59).

LATITUDINAL HEMISPHERE 1 A USE TABLE A FOR ALLOWABLE ENTRIES

LONGITUDE, DEGREES 3 N ALLOWABLE ENTRIES : (000 THROUGH 180).

LONGITUDE MINUTE(ANGULAR) 2 N ALLOWABLE ENTRIES : (00 THROUGH 59).

LONGITUDINAL HEMISPHERE 1 A USE TABLE B FOR ALLOWABLE ENTRIES

EXAMPLE : / 3510N07901W

EXPRESSED AS FOLLOWS : LATITUDE, DEGREES 2 N ALLOWABLE ENTRIES : (00 THROUGH 90).

LATITUDE MINUTE(ANGULAR) 2 N ALLOWABLE ENTRIES : (00 THROUGH 59).

LATITUDE SECOND(ANGULAR) 2 N ALLOWABLE ENTRIES : (00 THROUGH 59).

LATITUDINAL HEMISPHERE 1 A USE TABLE A FOR ALLOWABLE ENTRIES

LONGITUDE, DEGREES 3 N ALLOWABLE ENTRIES : (000 THROUGH 180).

LONGITUDE MINUTE(ANGULAR) 2 N ALLOWABLE ENTRIES : (00 THROUGH 59).

LONGITUDE SECOND(ANGULAR) 2 N ALLOWABLE ENTRIES : (00 THROUGH 59).

LONGITUDINAL HEMISPHERE 1 A EXAMPLE : / 351025N0790125W

Constructor & Destructor Documentation

◆ LatLon()

Member Function Documentation

◆ GetFormattedLatLon() [1/2]

◆ GetFormattedLatLon() [2/2]

std::string usmtf::LatLon::GetFormattedLatLon ( const UtLLPos & position)
staticnoexcept

◆ GetLatDegree()

const std::string & usmtf::LatLon::GetLatDegree ( ) const
noexcept

References mLattitudinalDegree.

Referenced by LatLon().

◆ GetLatHemisphere()

const std::string & usmtf::LatLon::GetLatHemisphere ( ) const
noexcept

References mLatHemisphere.

Referenced by LatLon().

◆ GetLatMinutes()

const std::string & usmtf::LatLon::GetLatMinutes ( ) const
noexcept

References mLatMinutes.

Referenced by LatLon().

◆ GetLatSeconds()

const std::string & usmtf::LatLon::GetLatSeconds ( ) const
noexcept

References mLatSeconds.

Referenced by LatLon().

◆ GetLonDegree()

const std::string & usmtf::LatLon::GetLonDegree ( ) const
noexcept

References mLongitudinalDegree.

Referenced by LatLon().

◆ GetLonHemisphere()

const std::string & usmtf::LatLon::GetLonHemisphere ( ) const
noexcept

References mLonHemisphere.

Referenced by LatLon().

◆ GetLonMinutes()

const std::string & usmtf::LatLon::GetLonMinutes ( ) const
noexcept

References mLonMinutes.

Referenced by LatLon().

◆ GetLonSeconds()

const std::string & usmtf::LatLon::GetLonSeconds ( ) const
noexcept

References mLonSeconds.

Referenced by LatLon().

◆ GetUtLLPos()

const UtLLPos & usmtf::LatLon::GetUtLLPos ( ) const
noexcept

UtLLPos are a most useful entity in the AFSIM framework. Instead of reinventing the wheel in LatLon, we make an attempt to use UtLLPos when they fulfill our need.

References mUtLLPos.

Referenced by GetFormattedLatLon(), and LatLon().

◆ IsValidLatLonMinutes()

◆ IsValidLatLonSeconds()

◆ IsValidLattitudinalDegree()

bool usmtf::LatLon::IsValidLattitudinalDegree ( const std::string & aValue)
protectednoexcept

◆ IsValidLattitudinalHemisphere()

bool usmtf::LatLon::IsValidLattitudinalHemisphere ( const std::string & aValue)
protectednoexcept

◆ IsValidLongitudinalDegree()

bool usmtf::LatLon::IsValidLongitudinalDegree ( const std::string & aValue)
protectednoexcept

◆ IsValidLongitudinalHemisphere()

bool usmtf::LatLon::IsValidLongitudinalHemisphere ( const std::string & aValue)
protectednoexcept

◆ IsValidMinuteOrSecond()

bool usmtf::LatLon::IsValidMinuteOrSecond ( const std::string & aValue)
protectednoexcept

◆ ParseAndValidate()

bool usmtf::LatLon::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.

Implements usmtf::FFIRN_Validator.

Reimplemented in usmtf::NamedLocation.

References usmtf::ffirn_descriptors::cLATM, usmtf::ffirn_descriptors::cLATS, IsValidLatLonMinutes(), IsValidLatLonSeconds(), usmtf::FFIRN_Validator::SetField(), SetUtLLPos(), and usmtf::FFIRN_Validator::ValidateByDescriptor().

Referenced by LatLon(), and usmtf::NamedLocation::ParseAndValidate().

◆ SetUtLLPos()

void usmtf::LatLon::SetUtLLPos ( )
protectednoexcept

Member Data Documentation

◆ mLatHemisphere

std::string usmtf::LatLon::mLatHemisphere
protected

◆ mLatMinutes

std::string usmtf::LatLon::mLatMinutes
protected

◆ mLatSeconds

std::string usmtf::LatLon::mLatSeconds
protected

◆ mLattitudinalDegree

std::string usmtf::LatLon::mLattitudinalDegree
protected

◆ mLongitudinalDegree

std::string usmtf::LatLon::mLongitudinalDegree
protected

◆ mLonHemisphere

std::string usmtf::LatLon::mLonHemisphere
protected

◆ mLonMinutes

std::string usmtf::LatLon::mLonMinutes
protected

◆ mLonSeconds

std::string usmtf::LatLon::mLonSeconds
protected

◆ mUtLLPos

UtLLPos usmtf::LatLon::mUtLLPos
protected

Referenced by GetUtLLPos(), and SetUtLLPos().


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