mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
made derived() private instead of protected in CRTP
This commit is contained in:
@@ -23,13 +23,30 @@ namespace PhysicalQuantities
|
||||
*/
|
||||
template <class MU, class PQ> class CPhysicalQuantity : public BlackMisc::CBaseStreamStringifier<PQ>
|
||||
{
|
||||
|
||||
private:
|
||||
double m_unitValueD; //!< value backed by double
|
||||
qint32 m_unitValueI; //!< value backed by integer, allows sole integer arithmetic
|
||||
double m_convertedSiUnitValueD; //!< SI unit value
|
||||
bool m_isIntegerBaseValue; //!< flag integer? / double?
|
||||
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
PQ const* derived() const
|
||||
{
|
||||
return static_cast<PQ const *>(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
PQ* derived()
|
||||
{
|
||||
return static_cast<PQ *>(this);
|
||||
}
|
||||
|
||||
protected:
|
||||
MU m_unit; //!< unit
|
||||
MU m_conversionSiUnit; //!< corresponding SI base unit
|
||||
@@ -59,24 +76,6 @@ protected:
|
||||
return this->unitValueRoundedWithUnit(-1);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
PQ const* derived() const
|
||||
{
|
||||
return static_cast<PQ const *>(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
PQ* derived()
|
||||
{
|
||||
return static_cast<PQ *>(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Init by integer
|
||||
* \param baseValue
|
||||
|
||||
Reference in New Issue
Block a user