From 6a813b50e4fc3bba829c3a94495d6061ea92bada Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 10 May 2009 19:25:36 +0200 Subject: fixing .hgignore adding cdat --- ue3/mycpu/cdat.cpp | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 ue3/mycpu/cdat.cpp (limited to 'ue3/mycpu/cdat.cpp') diff --git a/ue3/mycpu/cdat.cpp b/ue3/mycpu/cdat.cpp new file mode 100644 index 0000000..455d3bc --- /dev/null +++ b/ue3/mycpu/cdat.cpp @@ -0,0 +1,126 @@ +/** + * @module cdat + * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) + * @brief TODO + * @date 10.05.2009 + */ + +#include "cdat.h" + + +int CDat::value() const +{ + return m_value; +} + +/*----------------------------------------------------------------------------*/ + +bool CDat::operator<(const CDat& x) const +{ + return m_value < x.m_value; +} + +/*----------------------------------------------------------------------------*/ + +bool CDat::operator==(const CDat& x) const +{ + return m_value == x.m_value; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator+=(const CDat& x) +{ + m_value += x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator-=(const CDat& x) +{ + m_value -= x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator*=(const CDat& x) +{ + m_value *= x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator/=(const CDat& x) +{ + m_value /= x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator%=(const CDat& x) +{ + m_value %= x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator|=(const CDat& x) +{ + m_value |= x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator&=(const CDat& x) +{ + m_value &= x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator^=(const CDat& x) +{ + m_value ^= x.m_value; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator++() +{ + m_value++; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +CDat& CDat::operator--() +{ + m_value--; + return *this; +} + +/*----------------------------------------------------------------------------*/ + +std::ostream& operator<<(std::ostream& stream, CDat cdat) +{ + stream << cdat.m_value; + return stream; +} + +/*----------------------------------------------------------------------------*/ + +std::istream& operator>>(std::istream & stream, CDat& cdat) +{ + stream >> cdat.m_value; + return stream; +} + +/* vim: set et sw=2 ts=2: */ -- cgit v1.2.3