mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Added utility functions to avoid warnings converting int/double to float
This commit is contained in:
committed by
Roland Winklmeier
parent
75c481228f
commit
291780244b
@@ -97,6 +97,12 @@ namespace XSwiftBus
|
||||
//! Set the value of the dataref (if it is writable)
|
||||
void set(DataRefType d) { DataRefImpl::implSet(d); }
|
||||
|
||||
//! Set as integer, avoids cast warnings such as "possible loss of data"
|
||||
void setAsInt(int d) { this->set(static_cast<DataRefType>(d)); }
|
||||
|
||||
//! Set as integer, avoids cast warnings such as "possible loss of data"
|
||||
void setAsDouble(double d) { this->set(static_cast<DataRefType>(d)); }
|
||||
|
||||
//! Get the value of the dataref
|
||||
DataRefType get() const { return DataRefImpl::implGet<DataRefType>(); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user