From 2e75d238abe6742bfa0f97b9669aa7bc6fa65759 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 10 Jul 2011 14:20:18 +0200 Subject: add FbTk::makeRef function, for easier construction of RefCount pointers --- src/FbTk/RefCount.hh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/FbTk/RefCount.hh b/src/FbTk/RefCount.hh index 8adcc83..2595864 100644 --- a/src/FbTk/RefCount.hh +++ b/src/FbTk/RefCount.hh @@ -134,6 +134,26 @@ void RefCount::incRefCount() { (*m_refcount)++; } +template +inline RefCount makeRef() { + return RefCount(new Pointer); +} + +template +inline RefCount makeRef(const Arg1 &arg1) { + return RefCount(new Pointer(arg1)); +} + +template +inline RefCount makeRef(const Arg1 &arg1, const Arg2 &arg2) { + return RefCount(new Pointer(arg1, arg2)); +} + +template +inline RefCount makeRef(const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) { + return RefCount(new Pointer(arg1, arg2, arg3)); +} + } // end namespace FbTk #endif // FBTK_REFCOUNT_HH -- cgit v0.11.2