Ref T459 Update xswiftbus dataref classes to the latest available and use C++11.

This commit is contained in:
Mat Sutcliffe
2018-12-16 20:45:59 +00:00
parent acdbf9d43d
commit ceb6ff7451
3 changed files with 16562 additions and 13329 deletions

View File

@@ -2,10 +2,17 @@
#
# Script to generate C++ traits classes for all X-Plane datarefs.
#
# Copyright (C) 2014 VATSIM Community / contributors
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */
# Copyright (C) 2014 swift Project Community / contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
use strict;
use warnings;
@@ -118,19 +125,19 @@ ${in}//! $comment
${in}struct $key
${in}{
${in}${indent}//! Dataref name
${in}${indent}static const char *name() { return "$name"; }
${in}${indent}static constexpr const char *name() { return "$name"; }
${in}${indent}//! Can be written to?
${in}${indent}static const bool writable = $writable;
${in}${indent}static constexpr bool writable = $writable;
EOF
print <<"EOF" if $type =~ m(int|float|double);
${in}${indent}//! Dataref type
${in}${indent}typedef $type type;
${in}${indent}using type = $type;
EOF
print <<"EOF" if defined $size;
${in}${indent}//! Size of array dataref
${in}${indent}static const size_t size = $size;
${in}${indent}static constexpr size_t size = $size;
EOF
print <<"EOF";