From 8387099a3a9251fa91c9f346c29b340459e64ecc Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 21 Oct 2007 21:35:54 +0000 Subject: [PATCH] Tidying. git-svn-id: http://svn.voria.com/code@936 1f10aa63-cdf2-0310-b900-c93c546f37ac --- ETL/trunk/ETL/_handle.h | 187 ++++++++++++------------------------------------ 1 file changed, 47 insertions(+), 140 deletions(-) diff --git a/ETL/trunk/ETL/_handle.h b/ETL/trunk/ETL/_handle.h index 7eb7110..d0af39c 100644 --- a/ETL/trunk/ETL/_handle.h +++ b/ETL/trunk/ETL/_handle.h @@ -623,11 +623,6 @@ public: }; // END of template class rhandle - - - - - // ======================================================================== /*! \class loose_handle _handle.h ETL/handle ** \brief Loose Object Handle @@ -763,141 +758,53 @@ public: bool unref() { if(obj && !obj->unref()){ obj=0; return false; } return true; } }; // END of template class loose_handle - - - -template template handle -handle::cast_static(const loose_handle &x) - { return handle(static_cast(x.get())); } - -template template handle -handle::cast_dynamic(const loose_handle &x) - { return handle(dynamic_cast(x.get())); } - -template template handle -handle::cast_const(const loose_handle &x) - { return handle(const_cast(x.get())); } - -template template handle -handle::cast_reinterpret(const loose_handle &x) - { return handle(reinterpret_cast(x.get())); } - - - -template template handle -handle::cast_static(const rhandle &x) - { return handle(static_cast(x.get())); } - -template template handle -handle::cast_dynamic(const rhandle &x) - { return handle(dynamic_cast(x.get())); } - -template template handle -handle::cast_const(const rhandle &x) - { return handle(const_cast(x.get())); } - -template template handle -handle::cast_reinterpret(const rhandle &x) - { return handle(reinterpret_cast(x.get())); } - - - -template template handle -handle::cast_static(U* x) - { return handle(static_cast(x)); } - -template template handle -handle::cast_dynamic(U* x) - { return handle(dynamic_cast(x)); } - -template template handle -handle::cast_const(U* x) - { return handle(const_cast(x)); } - -template template handle -handle::cast_reinterpret(U* x) - { return handle(reinterpret_cast(x)); } - - - - - -template bool -operator==(const handle &lhs,const handle &rhs) - { return (lhs.get()==rhs.get()); } -template bool -operator==(const loose_handle &lhs,const loose_handle &rhs) - { return (lhs.get()==rhs.get()); } -template bool -operator==(const handle &lhs,const loose_handle &rhs) - { return (lhs.get()==rhs.get()); } -template bool -operator==(const loose_handle &lhs,const handle &rhs) - { return (lhs.get()==rhs.get()); } -template bool -operator==(const handle &lhs,const T *rhs) - { return (lhs.get()==rhs); } -template bool -operator==(const loose_handle &lhs,const T *rhs) - { return (lhs.get()==rhs); } -template bool -operator==(const T *lhs,const handle &rhs) - { return (lhs==rhs.get()); } -template bool -operator==(const T *lhs,const loose_handle &rhs) - { return (lhs==rhs.get()); } - - -template bool -operator!=(const handle &lhs,const handle &rhs) - { return (lhs.get()!=rhs.get()); } -template bool -operator!=(const loose_handle &lhs,const loose_handle &rhs) - { return (lhs.get()!=rhs.get()); } -template bool -operator!=(const handle &lhs,const loose_handle &rhs) - { return (lhs.get()!=rhs.get()); } -template bool -operator!=(const loose_handle &lhs,const handle &rhs) - { return (lhs.get()!=rhs.get()); } -template bool -operator!=(const handle &lhs,const T *rhs) - { return (lhs.get()!=rhs); } -template bool -operator!=(const loose_handle &lhs,const T *rhs) - { return (lhs.get()!=rhs); } -template bool -operator!=(const T *lhs,const handle &rhs) - { return (lhs!=rhs.get()); } -template bool -operator!=(const T *lhs,const loose_handle &rhs) - { return (lhs!=rhs.get()); } - - -template bool -operator<(const handle &lhs,const handle &rhs) - { return (lhs.get() bool -operator<(const loose_handle &lhs,const loose_handle &rhs) - { return (lhs.get() bool -operator<(const handle &lhs,const loose_handle &rhs) - { return (lhs.get() bool -operator<(const loose_handle &lhs,const handle &rhs) - { return (lhs.get() bool -operator<(const handle &lhs,const T *rhs) - { return (lhs.get() bool -operator<(const loose_handle &lhs,const T *rhs) - { return (lhs.get() bool -operator<(const T *lhs,const handle &rhs) - { return (lhs bool -operator<(const T *lhs,const loose_handle &rhs) - { return (lhs -> handle<> +template template handle handle::cast_static (const loose_handle& x) { return handle(static_cast (x.get())); } +template template handle handle::cast_dynamic (const loose_handle& x) { return handle(dynamic_cast (x.get())); } +template template handle handle::cast_const (const loose_handle& x) { return handle(const_cast (x.get())); } +template template handle handle::cast_reinterpret(const loose_handle& x) { return handle(reinterpret_cast(x.get())); } + +// cast rhandle_handle<> -> handle<> +template template handle handle::cast_static (const rhandle& x) { return handle(static_cast (x.get())); } +template template handle handle::cast_dynamic (const rhandle& x) { return handle(dynamic_cast (x.get())); } +template template handle handle::cast_const (const rhandle& x) { return handle(const_cast (x.get())); } +template template handle handle::cast_reinterpret(const rhandle& x) { return handle(reinterpret_cast(x.get())); } + +// cast U* -> handle<> +template template handle handle::cast_static (U* x) { return handle(static_cast (x)); } +template template handle handle::cast_dynamic (U* x) { return handle(dynamic_cast (x)); } +template template handle handle::cast_const (U* x) { return handle(const_cast (x)); } +template template handle handle::cast_reinterpret(U* x) { return handle(reinterpret_cast(x)); } + +// operator== for handle<>, loose_handle<> and T* +template bool operator==(const handle & lhs,const handle & rhs) { return (lhs.get()==rhs.get()); } +template bool operator==(const loose_handle& lhs,const loose_handle& rhs) { return (lhs.get()==rhs.get()); } +template bool operator==(const handle & lhs,const loose_handle& rhs) { return (lhs.get()==rhs.get()); } +template bool operator==(const loose_handle& lhs,const handle & rhs) { return (lhs.get()==rhs.get()); } +template bool operator==(const handle& lhs,const T* rhs) { return (lhs.get()==rhs); } +template bool operator==(const loose_handle& lhs,const T* rhs) { return (lhs.get()==rhs); } +template bool operator==(const T* lhs,const handle& rhs) { return (lhs ==rhs.get()); } +template bool operator==(const T* lhs,const loose_handle& rhs) { return (lhs ==rhs.get()); } + +// operator!= for handle<>, loose_handle<> and T* +template bool operator!=(const handle & lhs,const handle & rhs) { return (lhs.get()!=rhs.get()); } +template bool operator!=(const loose_handle& lhs,const loose_handle& rhs) { return (lhs.get()!=rhs.get()); } +template bool operator!=(const handle & lhs,const loose_handle& rhs) { return (lhs.get()!=rhs.get()); } +template bool operator!=(const loose_handle& lhs,const handle & rhs) { return (lhs.get()!=rhs.get()); } +template bool operator!=(const handle& lhs,const T* rhs) { return (lhs.get()!=rhs); } +template bool operator!=(const loose_handle& lhs,const T* rhs) { return (lhs.get()!=rhs); } +template bool operator!=(const T* lhs,const handle& rhs) { return (lhs !=rhs.get()); } +template bool operator!=(const T* lhs,const loose_handle& rhs) { return (lhs !=rhs.get()); } + +// operator< for handle<>, loose_handle<> and T* +template bool operator<(const handle& lhs,const handle& rhs) { return (lhs.get() bool operator<(const loose_handle& lhs,const loose_handle& rhs) { return (lhs.get() bool operator<(const handle& lhs,const loose_handle& rhs) { return (lhs.get() bool operator<(const loose_handle& lhs,const handle& rhs) { return (lhs.get() bool operator<(const handle& lhs,const T* rhs) { return (lhs.get() bool operator<(const loose_handle& lhs,const T* rhs) { return (lhs.get() bool operator<(const T* lhs,const handle& rhs) { return (lhs bool operator<(const T* lhs,const loose_handle& rhs) { return (lhs