WSF
WsfTSPI.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11// ****************************************************************************
12// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFTSPI_HPP
16#define WSFTSPI_HPP
17
18#include "wsf_export.h"
19
20#include <iosfwd>
21#include <string>
22
23class UtInput;
24
34{
35public:
36 WsfTSPI();
37 virtual ~WsfTSPI() = default;
38
39 virtual bool ProcessInput(UtInput& aInput);
40
41 friend WSF_EXPORT std::ostream& operator<<(std::ostream& aStream, const WsfTSPI& aTSPI);
42 friend WSF_EXPORT std::istream& operator>>(std::istream& aStream, WsfTSPI& aTSPI);
43
45 class Element
46 {
47 public:
48 Element() = default;
49 Element(double aValue, unsigned int aValueType);
50 ~Element() = default;
51
53 double operator()() const { return mAttribute; }
55 Element& operator=(const double aRhs)
56 {
57 mAttribute = aRhs;
58 return *this;
59 }
60
62 double Get() const { return mAttribute; }
64 void Set(double aAttribute) { mAttribute = aAttribute; }
65
67 void SetPersistentUnits(const std::string& aConversion);
69 void SetInverted(bool aIsInverted) { mIsInverted = aIsInverted; }
70
71 friend std::ostream& operator<<(std::ostream& aStream, const Element& aTSPI);
72 friend std::istream& operator>>(std::istream& aStream, Element& aTSPI);
73
74 private:
75 void ConvertInput();
76 double GetOutputValue() const;
77
78 double mAttribute = 0.0;
79 unsigned int mValueType = 0;
80 std::string mPersistentUnits;
81 bool mHasConversion = false;
82 bool mIsInverted = false;
83 };
84
93};
94
95#endif
std::ostream & operator<<(std::ostream &aStream, const WsfTSPI &aTSPI)
Stream out operator (typically, to a file); units are converted on output.
Definition WsfTSPI.cpp:92
std::istream & operator>>(std::istream &aStream, WsfTSPI &aTSPI)
Stream in operator (typically, from a file); units are converted on input.
Definition WsfTSPI.cpp:108
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
A single TSPI element (time, lat, heading, etc.).
Definition WsfTSPI.hpp:46
Element & operator=(const double aRhs)
Set the value of the element.
Definition WsfTSPI.hpp:55
Element()=default
void Set(double aAttribute)
Set the value of the element.
Definition WsfTSPI.hpp:64
double operator()() const
Return the value of the element.
Definition WsfTSPI.hpp:53
double Get() const
Return the value of the element.
Definition WsfTSPI.hpp:62
~Element()=default
void SetInverted(bool aIsInverted)
Set whether the value of the element is to be inverted (i.e., negated).
Definition WsfTSPI.hpp:69
Element mLon
Definition WsfTSPI.hpp:87
virtual ~WsfTSPI()=default
Element mHeading
Definition WsfTSPI.hpp:90
Element mPitch
Definition WsfTSPI.hpp:91
Element mRoll
Definition WsfTSPI.hpp:92
Element mAlt
Definition WsfTSPI.hpp:88
Element mLat
Definition WsfTSPI.hpp:86
Element mTime
Definition WsfTSPI.hpp:85
WsfTSPI()
Definition WsfTSPI.cpp:22
Element mSpeed
Definition WsfTSPI.hpp:89
virtual bool ProcessInput(UtInput &aInput)
Definition WsfTSPI.cpp:35
Copyrights Multiple, All Rights Reserved