11#include <simgear/debug/logstream.hxx>
18 "YASIM_VERSION_ORIGINAL",
22 "YASIM_VERSION_CURRENT",
25YASIM_VERSION Version::getByName(
const std::string&
name)
29 SG_LOG(SG_FLIGHT,SG_ALERT,
"Unknown yasim version '" <<
name <<
"' ignored, using YASIM_VERSION_ORIGINAL");
30 return YASIM_VERSION::ORIGINAL;
32 YASIM_VERSION v =
static_cast<YASIM_VERSION
>(std::distance(
VersionStrings.begin(), it));
33 if (v > YASIM_VERSION::CURRENT)
return YASIM_VERSION::CURRENT;
37std::string Version::getName(YASIM_VERSION v)
42void Version::setVersion(
const char * version )
44 const std::string v(version);
45 _version = getByName(v);
46 SG_LOG(SG_FLIGHT,SG_ALERT,
"This aircraft uses yasim version '" << v <<
"' (" << _version <<
")\n");
49Version::versionUnderlyingType Version::getVersion()
const
51 return static_cast<versionUnderlyingType
>(_version);
54std::ostream&
operator<<(std::ostream& os,
const YASIM_VERSION& version)
56 using underlying = std::underlying_type<YASIM_VERSION>::type;
57 return os << static_cast<underlying>(version);
std::ostream & operator<<(std::ostream &out, Rotor &r)
static const std::vector< std::string > VersionStrings