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
commita08ef4932fc6dcb812a7ceb5a87e8d144a6adda4 (patch)
tree402ac87cced38b6119fa9398140c72de83eb5316 /libs/utils/RefBase.cpp
parent62021d21457e6fa7dcc93b065e761516e75e872d (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 0bd1af4ebf..f934eec80f 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