From a688b574d294faae5f56224908b40856c5045aac Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 16 Feb 2011 15:23:08 -0800 Subject: Remove RefBase.h dependency on TextOutput.h Change-Id: I72cd6b98ef82b4868fe1c8ec87862cf43fb4ee73 --- include/utils/RefBase.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h index c24c0db..f8d96cf 100644 --- a/include/utils/RefBase.h +++ b/include/utils/RefBase.h @@ -18,7 +18,6 @@ #define ANDROID_REF_BASE_H #include -#include #include #include @@ -27,6 +26,10 @@ // --------------------------------------------------------------------------- namespace android { +class TextOutput; +TextOutput& printStrongPointer(TextOutput& to, const void* val); +TextOutput& printWeakPointer(TextOutput& to, const void* val); + template class wp; // --------------------------------------------------------------------------- @@ -427,8 +430,7 @@ sp::sp(T* p, weakref_type* refs) template inline TextOutput& operator<<(TextOutput& to, const sp& val) { - to << "sp<>(" << val.get() << ")"; - return to; + return printStrongPointer(to, val.get()); } // --------------------------------------------------------------------------- @@ -585,8 +587,7 @@ void wp::clear() template inline TextOutput& operator<<(TextOutput& to, const wp& val) { - to << "wp<>(" << val.unsafe_get() << ")"; - return to; + return printWeakPointer(to, val.unsafe_get()); } }; // namespace android -- cgit v1.1