diff options
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/RefCount.hh | 20 |
1 files changed, 20 insertions, 0 deletions
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<Pointer>::incRefCount() { | |||
134 | (*m_refcount)++; | 134 | (*m_refcount)++; |
135 | } | 135 | } |
136 | 136 | ||
137 | template <typename Pointer> | ||
138 | inline RefCount<Pointer> makeRef() { | ||
139 | return RefCount<Pointer>(new Pointer); | ||
140 | } | ||
141 | |||
142 | template <typename Pointer, typename Arg1> | ||
143 | inline RefCount<Pointer> makeRef(const Arg1 &arg1) { | ||
144 | return RefCount<Pointer>(new Pointer(arg1)); | ||
145 | } | ||
146 | |||
147 | template <typename Pointer, typename Arg1, typename Arg2> | ||
148 | inline RefCount<Pointer> makeRef(const Arg1 &arg1, const Arg2 &arg2) { | ||
149 | return RefCount<Pointer>(new Pointer(arg1, arg2)); | ||
150 | } | ||
151 | |||
152 | template <typename Pointer, typename Arg1, typename Arg2, typename Arg3> | ||
153 | inline RefCount<Pointer> makeRef(const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) { | ||
154 | return RefCount<Pointer>(new Pointer(arg1, arg2, arg3)); | ||
155 | } | ||
156 | |||
137 | } // end namespace FbTk | 157 | } // end namespace FbTk |
138 | 158 | ||
139 | #endif // FBTK_REFCOUNT_HH | 159 | #endif // FBTK_REFCOUNT_HH |