diff options
author | Mathias Agopian <mathias@google.com> | 2011-02-23 15:23:13 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-02-23 15:23:13 -0800 |
commit | 7f97c4ef12263a70a5c9ee7cd16f194c0240e658 (patch) | |
tree | b0ca0631106dac07c5a9aa0423f4b1cc9652fe87 /include | |
parent | 17f49e4f91c04290721dc029b73b9a430f5298d5 (diff) | |
parent | a688b574d294faae5f56224908b40856c5045aac (diff) | |
download | frameworks_base-7f97c4ef12263a70a5c9ee7cd16f194c0240e658.zip frameworks_base-7f97c4ef12263a70a5c9ee7cd16f194c0240e658.tar.gz frameworks_base-7f97c4ef12263a70a5c9ee7cd16f194c0240e658.tar.bz2 |
Merge "Remove RefBase.h dependency on TextOutput.h"
Diffstat (limited to 'include')
-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 |