refs #345 Third and final wave of value classes using the CValueObjectStdTuple CRTP class template, with policy classes.

This commit is contained in:
Mathew Sutcliffe
2014-11-08 00:17:13 +00:00
parent 2b9d4098d4
commit f219d290f1
48 changed files with 326 additions and 1389 deletions

View File

@@ -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