mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #345 Third and final wave of value classes using the CValueObjectStdTuple CRTP class template, with policy classes.
This commit is contained in:
@@ -16,13 +16,24 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Math { class CVector3D; }
|
||||
|
||||
//! \private
|
||||
template <> struct CValueObjectStdTuplePolicy<Math::CVector3D> : public CValueObjectStdTuplePolicy<>
|
||||
{
|
||||
using Compare = Policy::Compare::Own;
|
||||
using Hash = Policy::Hash::Own;
|
||||
using DBus = Policy::DBus::Own;
|
||||
using Json = Policy::Json::Own;
|
||||
};
|
||||
|
||||
namespace Math
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief Concrete vector implementation
|
||||
*/
|
||||
class CVector3D : public CVector3DBase<CVector3D>
|
||||
class CVector3D : public CValueObjectStdTuple<CVector3D, CVector3DBase<CVector3D>>
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
@@ -33,12 +44,12 @@ namespace BlackMisc
|
||||
/*!
|
||||
* \brief Constructor by value
|
||||
*/
|
||||
CVector3D(double i, double j, double k) : CVector3DBase(i, j, k) {}
|
||||
CVector3D(double i, double j, double k) : CValueObjectStdTuple(i, j, k) {}
|
||||
|
||||
/*!
|
||||
* \brief Constructor by value
|
||||
*/
|
||||
explicit CVector3D(double value) : CVector3DBase(value) {}
|
||||
explicit CVector3D(double value) : CValueObjectStdTuple(value) {}
|
||||
|
||||
/*!
|
||||
* \brief i
|
||||
|
||||
Reference in New Issue
Block a user