some fixes and comparison interface for Unit and Quantity python objects

This commit is contained in:
jriegel
2013-12-06 00:06:40 +01:00
parent 01d69071b6
commit 272e60671b
9 changed files with 226 additions and 53 deletions

View File

@@ -71,6 +71,14 @@ bool Quantity::operator ==(const Quantity& that) const
return (this->_Value == that._Value) && (this->_Unit == that._Unit) ;
}
bool Quantity::operator <(const Quantity& that) const
{
if(this->_Unit != that._Unit)
throw Base::Exception("Quantity::operator <(): quantities need to have same unit to compare");
return (this->_Value < that._Value) ;
}
Quantity Quantity::operator *(const Quantity &p) const
{