diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-10 12:20:18 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-07-10 17:44:42 (GMT) |
commit | 9c290a6d911fa9aac5b410381c721e29c572c9be (patch) | |
tree | 1a329731fdbb352d6d26e68667908ff40f352f9e /src | |
parent | d73166cb97b24fdfa47b6cdf2a5f747a3ec1a368 (diff) | |
download | fluxbox_pavel-9c290a6d911fa9aac5b410381c721e29c572c9be.zip fluxbox_pavel-9c290a6d911fa9aac5b410381c721e29c572c9be.tar.bz2 |
add FbTk::makeRef function, for easier construction of RefCount pointers
Diffstat (limited to 'src')
-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 |