refs #403 Add Policy::MetaType::None for base class templates

This commit is contained in:
Roland Winklmeier
2015-04-21 00:05:39 +02:00
parent e5e8cf00ef
commit 38b00e06b3
18 changed files with 116 additions and 2 deletions

View File

@@ -14,6 +14,15 @@
namespace BlackMisc namespace BlackMisc
{ {
namespace Aviation { class CAvionicsBase; }
//! \private
template <> struct CValueObjectPolicy<Aviation::CAvionicsBase> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::None;
};
namespace Aviation namespace Aviation
{ {

View File

@@ -21,6 +21,7 @@ namespace BlackMisc
//! \private //! \private
template <> struct CValueObjectPolicy<Aviation::CComSystem> : public CValueObjectPolicy<> template <> struct CValueObjectPolicy<Aviation::CComSystem> : public CValueObjectPolicy<>
{ {
using MetaType = Policy::MetaType::Default;
using LessThan = Policy::LessThan::None; using LessThan = Policy::LessThan::None;
using Compare = Policy::Compare::None; using Compare = Policy::Compare::None;
using Hash = Policy::Hash::Own; using Hash = Policy::Hash::Own;

View File

@@ -16,6 +16,15 @@
namespace BlackMisc namespace BlackMisc
{ {
namespace Aviation { class CTransponder; }
//! \private
template <> struct CValueObjectPolicy<Aviation::CTransponder> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::Default;
};
namespace Aviation namespace Aviation
{ {
//! Transponder //! Transponder

View File

@@ -49,7 +49,9 @@ namespace BlackMisc
//! \private //! \private
template <template <class> class C, class T, class CIt> template <template <class> class C, class T, class CIt>
struct CValueObjectPolicy<CContainerBase<C, T, CIt>> : public CValueObjectLegacy struct CValueObjectPolicy<CContainerBase<C, T, CIt>> : public CValueObjectLegacy
{}; {
using MetaType = Policy::MetaType::None;
};
/*! /*!
* \brief Base class for CCollection and CSequence adding mutating operations and CValueObject facility on top of CRangeBase. * \brief Base class for CCollection and CSequence adding mutating operations and CValueObject facility on top of CRangeBase.

View File

@@ -16,6 +16,14 @@
namespace BlackMisc namespace BlackMisc
{ {
namespace Geo { template <class> class CEarthAngle; }
//! \private
template <class LATorLON> struct CValueObjectPolicy<Geo::CEarthAngle<LATorLON>> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::None;
};
namespace Geo namespace Geo
{ {
/*! /*!

View File

@@ -17,6 +17,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<Geo::CLatitude> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::Default;
};
namespace Geo namespace Geo
{ {

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<Geo::CLongitude> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::Default;
};
namespace Geo namespace Geo
{ {

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CAcceleration> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {

View File

@@ -17,6 +17,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CAngle> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {
//! Physical unit angle (radians, degrees) //! Physical unit angle (radians, degrees)

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CFrequency> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {
/*! /*!

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CLength> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CMass> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {

View File

@@ -31,7 +31,7 @@ namespace BlackMisc
//! \private //! \private
template <class MU, class PQ> struct CValueObjectPolicy<PhysicalQuantities::CPhysicalQuantity<MU, PQ>> : public CValueObjectPolicy<> template <class MU, class PQ> struct CValueObjectPolicy<PhysicalQuantities::CPhysicalQuantity<MU, PQ>> : public CValueObjectPolicy<>
{ {
using MetaType = Policy::MetaType::DefaultAndQList; using MetaType = Policy::MetaType::None;
using Equals = Policy::Equals::None; using Equals = Policy::Equals::None;
using LessThan = Policy::LessThan::None; using LessThan = Policy::LessThan::None;
using Compare = Policy::Compare::None; using Compare = Policy::Compare::None;

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CPressure> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CSpeed> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CTemperature> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {

View File

@@ -16,6 +16,13 @@
namespace BlackMisc namespace BlackMisc
{ {
//! \private
template <> struct CValueObjectPolicy<PhysicalQuantities::CTime> : public CValueObjectPolicy<>
{
using MetaType = Policy::MetaType::DefaultAndQList;
};
namespace PhysicalQuantities namespace PhysicalQuantities
{ {

View File

@@ -80,6 +80,14 @@ namespace BlackMisc
template <class T, class...> template <class T, class...>
static void registerImpl() { Default::registerImpl<T>(); Default::registerImpl<QList<T>>(); } static void registerImpl() { Default::registerImpl<T>(); Default::registerImpl<QList<T>>(); }
}; };
//! CValueObject policy for a class which should not register itself as meta type
struct None
{
//! Register with QMetaType
template <class T, class...>
static void registerImpl() { }
};
} }
namespace Equals namespace Equals