aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-10 12:20:18 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-09-14 17:39:10 (GMT)
commit2e75d238abe6742bfa0f97b9669aa7bc6fa65759 (patch)
tree1c295d02bfe0c9e79e85a86e77e732f5a5aecf4a /src
parentcfcc4d44aa07c0e33ee299e38c94e3f7f6c0458e (diff)
downloadfluxbox_paul-2e75d238abe6742bfa0f97b9669aa7bc6fa65759.zip
fluxbox_paul-2e75d238abe6742bfa0f97b9669aa7bc6fa65759.tar.bz2
add FbTk::makeRef function, for easier construction of RefCount pointers
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/RefCount.hh20
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
137template <typename Pointer>
138inline RefCount<Pointer> makeRef() {
139 return RefCount<Pointer>(new Pointer);
140}
141
142template <typename Pointer, typename Arg1>
143inline RefCount<Pointer> makeRef(const Arg1 &arg1) {
144 return RefCount<Pointer>(new Pointer(arg1));
145}
146
147template <typename Pointer, typename Arg1, typename Arg2>
148inline RefCount<Pointer> makeRef(const Arg1 &arg1, const Arg2 &arg2) {
149 return RefCount<Pointer>(new Pointer(arg1, arg2));
150}
151
152template <typename Pointer, typename Arg1, typename Arg2, typename Arg3>
153inline 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