From 26a97259f5a7b066cff2927e88c867fac2aaad87 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 26 May 2009 23:10:13 +0200 Subject: template FTW!!!!!11 --- ue4/mycpu/cdat.h | 109 ++++++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 58 deletions(-) (limited to 'ue4/mycpu/cdat.h') diff --git a/ue4/mycpu/cdat.h b/ue4/mycpu/cdat.h index a533fae..ca9d745 100644 --- a/ue4/mycpu/cdat.h +++ b/ue4/mycpu/cdat.h @@ -2,7 +2,7 @@ * @module cdat * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) * @brief Datatype template and datatype definition for CCPU and CMem - * @date 10.05.2009 + * @date 26.05.2009 */ #ifndef CDAT_H @@ -12,17 +12,17 @@ #include /** - * @class CDatT + * @class CDat * * Datatype template for CCPU and CMem. */ template -class CDatT - : boost::operators > +class CDat + : boost::operators > { public: /** - * @method CDatT + * @method CDat * @brief Default ctor * @param - * @return - @@ -30,11 +30,11 @@ class CDatT * @exception bad_alloc * @conditions none */ - CDatT() + CDat() {} /** - * @method ~CDatT + * @method ~CDat * @brief Default dtor * @param - * @return - @@ -42,40 +42,40 @@ class CDatT * @exception none * @conditions none */ - ~CDatT() + ~CDat() {} /** - * @method CDatT - * @brief Copy constructor for CDatT - * @param other reference to CDatT which will be copied + * @method CDat + * @brief Copy constructor for CDat + * @param other reference to CDat which will be copied * @return - * @globalvars none * @exception none * @conditions none */ - CDatT(const CDatT& other) + CDat(const CDat& other) : m_value(other.m_value) {} /** - * @method CDatT + * @method CDat * @brief Copy constructor for int - * @param newval new value for CDatT + * @param newval new value for CDat * @return - * @globalvars none * @exception none * @conditions none */ - CDatT(T newval) + CDat(T newval) : m_value(newval) {} /** * @method getValue - * @brief returns value of CDatT + * @brief returns value of CDat * @param - - * @return value of CDatT + * @return value of CDat * @globalvars none * @exception none * @conditions none @@ -102,13 +102,13 @@ class CDatT /** * @method operator< * @brief implementation of operator < - * @param x reference to CDatT + * @param x reference to CDat * @return true if cdat is less than object x * @globalvars none * @exception none * @conditions none */ - bool operator<(const CDatT& x) const + bool operator<(const CDat& x) const { return m_value < x.m_value; } @@ -116,13 +116,13 @@ class CDatT /** * @method operator== * @brief implementation of operator == - * @param x reference to CDatT + * @param x reference to CDat * @return true if cdat equals object x * @globalvars none * @exception none * @conditions none */ - bool operator==(const CDatT& x) const + bool operator==(const CDat& x) const { return m_value == x.m_value; } @@ -130,13 +130,13 @@ class CDatT /** * @method operator+= * @brief implementation of operator += - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator+=(const CDatT& x) + CDat& operator+=(const CDat& x) { m_value += x.m_value; return *this; @@ -145,13 +145,13 @@ class CDatT /** * @method operator-= * @brief implementation of operator -= - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator-=(const CDatT& x) + CDat& operator-=(const CDat& x) { m_value -= x.m_value; return *this; @@ -160,13 +160,13 @@ class CDatT /** * @method operator*= * @brief implementation of operator *= - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator*=(const CDatT& x) + CDat& operator*=(const CDat& x) { m_value *= x.m_value; return *this; @@ -175,13 +175,13 @@ class CDatT /** * @method operator/= * @brief implementation of operator /= - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator/=(const CDatT& x) + CDat& operator/=(const CDat& x) { m_value /= x.m_value; return *this; @@ -190,13 +190,13 @@ class CDatT /** * @method operator%= * @brief implementation of operator %= - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator%=(const CDatT& x) + CDat& operator%=(const CDat& x) { m_value %= x.m_value; return *this; @@ -205,13 +205,13 @@ class CDatT /** * @method operator|= * @brief implementation of operator |= - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator|=(const CDatT& x) + CDat& operator|=(const CDat& x) { m_value |= x.m_value; return *this; @@ -220,13 +220,13 @@ class CDatT /** * @method operator&= * @brief implementation of operator &= - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator&=(const CDatT& x) + CDat& operator&=(const CDat& x) { m_value &= x.m_value; return *this; @@ -235,13 +235,13 @@ class CDatT /** * @method operator^= * @brief implementation of operator ^= - * @param x reference to CDatT - * @return refecence to CDatT + * @param x reference to CDat + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator^=(const CDatT& x) + CDat& operator^=(const CDat& x) { m_value ^= x.m_value; return *this; @@ -251,12 +251,12 @@ class CDatT * @method operator++ * @brief implementation of operator ++ * @param - - * @return refecence to CDatT + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator++() + CDat& operator++() { m_value++; return *this; @@ -266,12 +266,12 @@ class CDatT * @method operator-- * @brief implementation of operator -- * @param - - * @return refecence to CDatT + * @return refecence to CDat * @globalvars none * @exception none * @conditions none */ - CDatT& operator--() + CDat& operator--() { m_value--; return *this; @@ -287,7 +287,7 @@ class CDatT * @exception none * @conditions none */ - friend std::ostream& operator<<(std::ostream& stream, CDatT cdat) + friend std::ostream& operator<<(std::ostream& stream, CDat cdat) { stream << cdat.m_value; return stream; @@ -303,7 +303,7 @@ class CDatT * @exception none * @conditions none */ - friend std::istream& operator>>(std::istream & stream, CDatT& cdat) + friend std::istream& operator>>(std::istream & stream, CDat& cdat) { stream >> cdat.m_value; return stream; @@ -314,13 +314,6 @@ class CDatT T m_value; }; -/** - * @class CDat - * - * Datatype for CCPU and CMem - */ -typedef CDatT CDat; - #endif /* vim: set et sw=2 ts=2: */ -- cgit v1.2.3