diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-10 12:20:18 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-09-14 17:39:10 (GMT) |
commit | 2e75d238abe6742bfa0f97b9669aa7bc6fa65759 (patch) | |
tree | 1c295d02bfe0c9e79e85a86e77e732f5a5aecf4a /src | |
parent | cfcc4d44aa07c0e33ee299e38c94e3f7f6c0458e (diff) | |
download | fluxbox-2e75d238abe6742bfa0f97b9669aa7bc6fa65759.zip fluxbox-2e75d238abe6742bfa0f97b9669aa7bc6fa65759.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 |