summaryrefslogtreecommitdiff
path: root/libs/utils/RefBase.cpp
diff options
context:
space:
mode:
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
commita688b574d294faae5f56224908b40856c5045aac (patch)
tree2af92697194f007d9e0beb044c005a863ac40a85 /libs/utils/RefBase.cpp
parent5fb008e3800032be18c6d5f1e7ace4d7c2661e26 (diff)
Remove RefBase.h dependency on TextOutput.h
Change-Id: I72cd6b98ef82b4868fe1c8ec87862cf43fb4ee73
Diffstat (limited to 'libs/utils/RefBase.cpp')
-rw-r--r--libs/utils/RefBase.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp
index 0bd1af4ebf18..f934eec80f80 100644
--- a/libs/utils/RefBase.cpp
+++ b/libs/utils/RefBase.cpp
@@ -23,6 +23,7 @@
#include <utils/KeyedVector.h>
#include <utils/Log.h>
#include <utils/threads.h>
+#include <utils/TextOutput.h>
#include <stdlib.h>
#include <stdio.h>
@@ -530,5 +531,20 @@ bool RefBase::onIncStrongAttempted(uint32_t flags, const void* id)
void RefBase::onLastWeakRef(const void* /*id*/)
{
}
-
+
+// ---------------------------------------------------------------------------
+
+TextOutput& printStrongPointer(TextOutput& to, const void* val)
+{
+ to << "sp<>(" << val << ")";
+ return to;
+}
+
+TextOutput& printWeakPointer(TextOutput& to, const void* val)
+{
+ to << "wp<>(" << val << ")";
+ return to;
+}
+
+
}; // namespace android