mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 12:55:31 +08:00
Ref T459 Update xswiftbus dataref classes to the latest available and use C++11.
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user