diff options
| author | 2011-02-23 15:23:13 -0800 | |
|---|---|---|
| committer | 2011-02-23 15:23:13 -0800 | |
| commit | 7f97c4ef12263a70a5c9ee7cd16f194c0240e658 (patch) | |
| tree | b0ca0631106dac07c5a9aa0423f4b1cc9652fe87 /include/utils/RefBase.h | |
| parent | 17f49e4f91c04290721dc029b73b9a430f5298d5 (diff) | |
| parent | a688b574d294faae5f56224908b40856c5045aac (diff) | |
Merge "Remove RefBase.h dependency on TextOutput.h"
Diffstat (limited to 'include/utils/RefBase.h')
| -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 c24c0dbcb28f..f8d96cf1e84c 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 |