WSF
usmtf::EllipticalArea Class Reference

#include <EllipticalArea.hpp>

Inheritance diagram for usmtf::EllipticalArea:
Collaboration diagram for usmtf::EllipticalArea:

Public Member Functions

 EllipticalArea ()=default
bool ParseAndValidate (const Field &aField) override
const std::string & GetHorizontalAxisDistance () const noexcept
const std::string & GetHorizontalAxisUOM () const noexcept
const std::string & GetVerticalAxisDistance () const noexcept
const std::string & GetVerticalAxisUOM () const noexcept
float GetAngleFromTrueNorth () 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 Types

enum class  Axis { Horizontal , Vertical }

Protected Member Functions

bool IsValidEllipsesArea ()
bool IsValidAxis (const std::string &aAxis, Axis axis)
bool IsValidDegree (const std::string &aDegree)
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 mHorizontalAxisDistance
std::string mHorizontalAxisUOM
std::string mVerticalAxisDistance
std::string mVerticalAxisUOM
float mAngleInDegrees
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::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

Detailed Description

FFIRN_Validator responsible for the validation and property extraction of an ElipticalArea An EllipticalArea represents a space denoted by an ellipses.

Example: | Horizontal Axis | | Vertical Axis | | | Degree of rotation from True North, clockwise v v v 105M-200M-240.0

The mathematical terms major and minor axis are not used here but you can think of the smaller distance as the minor and the larger as the major

Member Enumeration Documentation

◆ Axis

enum class usmtf::EllipticalArea::Axis
strongprotected
Enumerator
Horizontal 
Vertical 

Constructor & Destructor Documentation

◆ EllipticalArea()

Member Function Documentation

◆ GetAngleFromTrueNorth()

float usmtf::EllipticalArea::GetAngleFromTrueNorth ( ) const
noexcept

References mAngleInDegrees.

Referenced by EllipticalArea().

◆ GetHorizontalAxisDistance()

const std::string & usmtf::EllipticalArea::GetHorizontalAxisDistance ( ) const
noexcept

References mHorizontalAxisDistance.

Referenced by EllipticalArea().

◆ GetHorizontalAxisUOM()

const std::string & usmtf::EllipticalArea::GetHorizontalAxisUOM ( ) const
noexcept

References mHorizontalAxisUOM.

Referenced by EllipticalArea().

◆ GetVerticalAxisDistance()

const std::string & usmtf::EllipticalArea::GetVerticalAxisDistance ( ) const
noexcept

References mVerticalAxisDistance.

Referenced by EllipticalArea().

◆ GetVerticalAxisUOM()

const std::string & usmtf::EllipticalArea::GetVerticalAxisUOM ( ) const
noexcept

References mVerticalAxisUOM.

Referenced by EllipticalArea().

◆ IsValidAxis()

◆ IsValidDegree()

bool usmtf::EllipticalArea::IsValidDegree ( const std::string & aDegree)
protected

◆ IsValidEllipsesArea()

◆ ParseAndValidate()

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

References IsValidEllipsesArea(), and usmtf::FFIRN_Validator::SetField().

Referenced by EllipticalArea().

Member Data Documentation

◆ mAngleInDegrees

float usmtf::EllipticalArea::mAngleInDegrees
protected

◆ mHorizontalAxisDistance

std::string usmtf::EllipticalArea::mHorizontalAxisDistance
protected

◆ mHorizontalAxisUOM

std::string usmtf::EllipticalArea::mHorizontalAxisUOM
protected

◆ mVerticalAxisDistance

std::string usmtf::EllipticalArea::mVerticalAxisDistance
protected

◆ mVerticalAxisUOM

std::string usmtf::EllipticalArea::mVerticalAxisUOM
protected

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