diff options
author | Mathias Agopian <mathias@google.com> | 2011-02-16 15:23:08 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-02-22 18:08:58 -0800 |
commit | a688b574d294faae5f56224908b40856c5045aac (patch) | |
tree | 2af92697194f007d9e0beb044c005a863ac40a85 /include/utils | |
parent | 5fb008e3800032be18c6d5f1e7ace4d7c2661e26 (diff) | |
download | frameworks_base-a688b574d294faae5f56224908b40856c5045aac.zip frameworks_base-a688b574d294faae5f56224908b40856c5045aac.tar.gz frameworks_base-a688b574d294faae5f56224908b40856c5045aac.tar.bz2 |
Remove RefBase.h dependency on TextOutput.h
Change-Id: I72cd6b98ef82b4868fe1c8ec87862cf43fb4ee73
Diffstat (limited to 'include/utils')
-rw-r--r-- | include/utils/RefBase.h | 11 |
1 files changed, 6 insertions, 5 deletions
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 <cutils/atomic.h> -#include <utils/TextOutput.h> #include <stdint.h> #include <sys/types.h> @@ -27,6 +26,10 @@ // --------------------------------------------------------------------------- namespace android { +class TextOutput; +TextOutput& printStrongPointer(TextOutput& to, const void* val); +TextOutput& printWeakPointer(TextOutput& to, const void* val); + template<typename T> class wp; // --------------------------------------------------------------------------- @@ -427,8 +430,7 @@ sp<T>::sp(T* p, weakref_type* refs) template <typename T> inline TextOutput& operator<<(TextOutput& to, const sp<T>& val) { - to << "sp<>(" << val.get() << ")"; - return to; + return printStrongPointer(to, val.get()); } // --------------------------------------------------------------------------- @@ -585,8 +587,7 @@ void wp<T>::clear() template <typename T> inline TextOutput& operator<<(TextOutput& to, const wp<T>& val) { - to << "wp<>(" << val.unsafe_get() << ")"; - return to; + return printWeakPointer(to, val.unsafe_get()); } }; // namespace android |