Library of Assembled Shared Sources
 
Loading...
Searching...
No Matches
dispatcher_12.h
Go to the documentation of this file.
1/*
2 * *** ATTENTION! DO NOT MODIFY THIS FILE DIRECTLY! ***
3 *
4 * It has automatically been generated from dispatcher_x.tmpl.h
5 * by param_expander.py on Fri Aug 14 16:06:10 2026.
6 */
7
8/** @file
9 * @author Bram de Greve (bram@cocamware.com)
10 * @author Tom De Muer (tom@cocamware.com)
11 *
12 * *** BEGIN LICENSE INFORMATION ***
13 *
14 * The contents of this file are subject to the Common Public Attribution License
15 * Version 1.0 (the "License"); you may not use this file except in compliance with
16 * the License. You may obtain a copy of the License at
17 * http://lass.sourceforge.net/cpal-license. The License is based on the
18 * Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover
19 * use of software over a computer network and provide for limited attribution for
20 * the Original Developer. In addition, Exhibit A has been modified to be consistent
21 * with Exhibit B.
22 *
23 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
24 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
25 * language governing rights and limitations under the License.
26 *
27 * The Original Code is LASS - Library of Assembled Shared Sources.
28 *
29 * The Initial Developer of the Original Code is Bram de Greve and Tom De Muer.
30 * The Original Developer is the Initial Developer.
31 *
32 * All portions of the code written by the Initial Developer are:
33 * Copyright (C) 2004-2026 the Initial Developer.
34 * All Rights Reserved.
35 *
36 * Contributor(s):
37 *
38 * Alternatively, the contents of this file may be used under the terms of the
39 * GNU General Public License Version 2 or later (the GPL), in which case the
40 * provisions of GPL are applicable instead of those above. If you wish to allow use
41 * of your version of this file only under the terms of the GPL and not to allow
42 * others to use your version of this file under the CPAL, indicate your decision by
43 * deleting the provisions above and replace them with the notice and other
44 * provisions required by the GPL License. If you do not delete the provisions above,
45 * a recipient may use your version of this file under either the CPAL or the GPL.
46 *
47 * *** END LICENSE INFORMATION ***
48 */
49
50
51
52#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_IMPL_DISPATCHER_12_H
53#define LASS_GUARDIAN_OF_INCLUSION_UTIL_IMPL_DISPATCHER_12_H
54
57
58// --- NEW INTERFACES ----------------------------------------------------------
59
60namespace lass
61{
62namespace util
63{
64namespace impl
65{
66
67/** abstract base class of all dispatchers for lass::util::Callback12.
68 * @internal
69 * @sa Callback0
70 * @author Bram de Greve [Bramz]
71 */
72template
73<
74 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12
75>
76class Dispatcher12: public TDispatcherAllocatorBase
77{
78public:
79
80 Dispatcher12() {}
81 virtual ~Dispatcher12() {}
82
83 void call(typename util::CallTraits<P1>::TParam iP1, typename util::CallTraits<P2>::TParam iP2, typename util::CallTraits<P3>::TParam iP3, typename util::CallTraits<P4>::TParam iP4, typename util::CallTraits<P5>::TParam iP5, typename util::CallTraits<P6>::TParam iP6, typename util::CallTraits<P7>::TParam iP7, typename util::CallTraits<P8>::TParam iP8, typename util::CallTraits<P9>::TParam iP9, typename util::CallTraits<P10>::TParam iP10, typename util::CallTraits<P11>::TParam iP11, typename util::CallTraits<P12>::TParam iP12) const
84 {
85 doCall(iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12);
86 }
87 bool isEquivalent(const Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>* iOther) const
88 {
89 return doIsEquivalent(iOther);
90 }
91
92private:
93
94 virtual void doCall(typename util::CallTraits<P1>::TParam iP1, typename util::CallTraits<P2>::TParam iP2, typename util::CallTraits<P3>::TParam iP3, typename util::CallTraits<P4>::TParam iP4, typename util::CallTraits<P5>::TParam iP5, typename util::CallTraits<P6>::TParam iP6, typename util::CallTraits<P7>::TParam iP7, typename util::CallTraits<P8>::TParam iP8, typename util::CallTraits<P9>::TParam iP9, typename util::CallTraits<P10>::TParam iP10, typename util::CallTraits<P11>::TParam iP11, typename util::CallTraits<P12>::TParam iP12) const = 0;
95 virtual bool doIsEquivalent(const Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>* iOther) const = 0;
96
97 Dispatcher12(const Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>& iOther);
98 Dispatcher12& operator=(const Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>& iOther);
99};
100
101
102
103/** Dispatcher for lass::util::Callback12 to a free function:
104 * @internal
105 * @sa Callback0
106 * @author Bram de Greve [Bramz]
107 */
108template
109<
110 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12,
111 typename FunctionType,
112 typename Enable = void
113>
114class Dispatcher12Function: public Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>
115{
116public:
117
118 typedef FunctionType TFunction;
119 typedef Dispatcher12Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, FunctionType, Enable> TSelf;
120
121 Dispatcher12Function(typename CallTraits<TFunction>::TParam iFunction):
122 function_(iFunction)
123 {
124 }
125
126 const TFunction& function() const
127 {
128 return function_;
129 }
130
131private:
132
133 void doCall(typename util::CallTraits<P1>::TParam iP1, typename util::CallTraits<P2>::TParam iP2, typename util::CallTraits<P3>::TParam iP3, typename util::CallTraits<P4>::TParam iP4, typename util::CallTraits<P5>::TParam iP5, typename util::CallTraits<P6>::TParam iP6, typename util::CallTraits<P7>::TParam iP7, typename util::CallTraits<P8>::TParam iP8, typename util::CallTraits<P9>::TParam iP9, typename util::CallTraits<P10>::TParam iP10, typename util::CallTraits<P11>::TParam iP11, typename util::CallTraits<P12>::TParam iP12) const override
134 {
135 if (!function_)
136 {
137 return;
138 }
139 function_(iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12);
140 }
141
142 bool doIsEquivalent(const Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>* other) const override
143 {
144 if constexpr (impl::IsEqualityComparable<TFunction>::value)
145 {
146 return other && typeid( *other ) == typeid( TSelf )
147 && static_cast<const TSelf*>(other)->function_ == function_;
148 }
149 else
150 {
151 return false;
152 }
153 }
154
155 TFunction function_;
156};
157
158
159
160/** Dispatcher for lass::util::Callback12 to an object/method pair.
161 * @internal
162 * @sa Callback0
163 * @author Bram de Greve [Bramz]
164 */
165template
166<
167 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12,
168 typename ObjectPtr, typename Method
169>
170class Dispatcher12Method: public Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>
171{
172public:
173
174 typedef Dispatcher12Method<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, ObjectPtr, Method> TSelf;
175
176 Dispatcher12Method(typename CallTraits<ObjectPtr>::TParam iObject,
177 typename CallTraits<Method>::TParam iMethod):
178 object_(iObject),
179 method_(iMethod)
180 {
181 }
182
183private:
184
185 void doCall(typename util::CallTraits<P1>::TParam iP1, typename util::CallTraits<P2>::TParam iP2, typename util::CallTraits<P3>::TParam iP3, typename util::CallTraits<P4>::TParam iP4, typename util::CallTraits<P5>::TParam iP5, typename util::CallTraits<P6>::TParam iP6, typename util::CallTraits<P7>::TParam iP7, typename util::CallTraits<P8>::TParam iP8, typename util::CallTraits<P9>::TParam iP9, typename util::CallTraits<P10>::TParam iP10, typename util::CallTraits<P11>::TParam iP11, typename util::CallTraits<P12>::TParam iP12) const override
186 {
187 if (!object_ || !method_)
188 {
189 return;
190 }
191 ((*object_).*method_)(iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12);
192 }
193
194 bool doIsEquivalent(const Dispatcher12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>* iOther) const override
195 {
196 const TSelf* other = dynamic_cast<const TSelf*>(iOther);
197 return other && object_ == other->object_ && method_ == other->method_;
198 }
199
200 ObjectPtr object_;
201 Method method_;
202};
203
204
205
206}
207
208}
209
210}
211
212#endif // Guardian of Inclusion
213
214
215// EOF
general utility, debug facilities, ...
Library for Assembled Shared Sources.
Definition config.h:53