mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Fix const correctness in xbus dataRef
This commit is contained in:
committed by
Klaus Basan
parent
77e0165e9a
commit
58ae34d2e6
@@ -56,7 +56,7 @@ namespace XBus
|
||||
void implSetAt(size_t index, T);
|
||||
|
||||
template <typename T>
|
||||
T implGetAt(size_t index);
|
||||
T implGetAt(size_t index) const;
|
||||
|
||||
private:
|
||||
XPLMDataRef m_ref;
|
||||
@@ -179,9 +179,9 @@ namespace XBus
|
||||
template <>
|
||||
inline void ArrayDataRefImpl::implSetAt<float>(size_t i, float d) { assert(i <= m_size); XPLMSetDatavf(m_ref, &d, (int)i, 1); }
|
||||
template <>
|
||||
inline int ArrayDataRefImpl::implGetAt<int>(size_t i) { assert(i <= m_size); int d; XPLMGetDatavi(m_ref, &d, (int)i, 1); return d; }
|
||||
inline int ArrayDataRefImpl::implGetAt<int>(size_t i) const { assert(i <= m_size); int d; XPLMGetDatavi(m_ref, &d, (int)i, 1); return d; }
|
||||
template <>
|
||||
inline float ArrayDataRefImpl::implGetAt<float>(size_t i) { assert(i <= m_size); float d; XPLMGetDatavf(m_ref, &d, (int)i, 1); return d; }
|
||||
inline float ArrayDataRefImpl::implGetAt<float>(size_t i) const { assert(i <= m_size); float d; XPLMGetDatavf(m_ref, &d, (int)i, 1); return d; }
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user