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

@@ -23,82 +23,6 @@ namespace BlackMisc
return this->m_string;
}
/*
* is a
*/
bool CPqString::isA(int metaTypeId) const
{
if (metaTypeId == qMetaTypeId<CPqString>()) { return true; }
return this->CValueObject::isA(metaTypeId);
}
/*
* Meta id
*/
int CPqString::getMetaTypeId() const
{
return qMetaTypeId<CPqString>();
}
/*
* Compare
*/
int CPqString::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CPqString &>(otherBase);
return compare(TupleConverter<CPqString>::toTuple(*this), TupleConverter<CPqString>::toTuple(other));
}
/*
* Marshall to DBus
*/
void CPqString::marshallToDbus(QDBusArgument &argument) const
{
argument << TupleConverter<CPqString>::toTuple(*this);
}
/*
* Unmarshall from DBus
*/
void CPqString::unmarshallFromDbus(const QDBusArgument &argument)
{
argument >> TupleConverter<CPqString>::toTuple(*this);
}
/*
* Equal?
*/
bool CPqString::operator ==(const CPqString &other) const
{
if (this == &other) return true;
return TupleConverter<CPqString>::toTuple(*this) == TupleConverter<CPqString>::toTuple(other);
}
/*
* Unequal?
*/
bool CPqString::operator !=(const CPqString &other) const
{
return !((*this) == other);
}
/*
* Hash
*/
uint CPqString::getValueHash() const
{
return qHash(TupleConverter<CPqString>::toTuple(*this));
}
/*
* Register metadata
*/
void CPqString::registerMetadata()
{
qRegisterMetaType<CPqString>();
qDBusRegisterMetaType<CPqString>();
}
/*
* Parse
*/