Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Callback.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Callback.h
17  * @brief Function objects.
18  * Copyright (C) 2005-2010 Simon Newton
19  *
20  * THIS FILE IS AUTOGENERATED!
21  * Please run edit & run gen_callbacks.py if you need to add more types.
22  */
23 
105 #ifndef INCLUDE_OLA_CALLBACK_H_
106 #define INCLUDE_OLA_CALLBACK_H_
107 
108 namespace ola {
109 
118 template <typename ReturnType>
120  public:
121  virtual ~BaseCallback0() {}
122  virtual ReturnType Run() = 0;
123 };
124 
128 template <typename ReturnType>
129 class Callback0: public BaseCallback0<ReturnType> {
130  public:
131  virtual ~Callback0() {}
132  ReturnType Run() { return this->DoRun(); }
133  private:
134  virtual ReturnType DoRun() = 0;
135 };
136 
140 template <typename ReturnType>
141 class SingleUseCallback0: public BaseCallback0<ReturnType> {
142  public:
143  virtual ~SingleUseCallback0() {}
144  ReturnType Run() {
145  ReturnType ret = this->DoRun();
146  delete this;
147  return ret;
148  }
149  private:
150  virtual ReturnType DoRun() = 0;
151 };
152 
156 template <>
157 class SingleUseCallback0<void>: public BaseCallback0<void> {
158  public:
159  virtual ~SingleUseCallback0() {}
160  void Run() {
161  this->DoRun();
162  delete this;
163  }
164  private:
165  virtual void DoRun() = 0;
166 };
167 
171 template <typename Parent, typename ReturnType>
172 class FunctionCallback0_0: public Parent {
173  public:
174  typedef ReturnType (*Function)();
175  explicit FunctionCallback0_0(Function callback):
176  Parent(),
177  m_callback(callback) {}
178  ReturnType DoRun() {
179  return m_callback();
180  }
181  private:
182  Function m_callback;
183 };
184 
185 
193 template <typename ReturnType>
195  ReturnType (*callback)()) {
196  return new FunctionCallback0_0<
198  ReturnType>(
199  callback);
200 }
201 
202 
210 template <typename ReturnType>
212  ReturnType (*callback)()) {
213  return new FunctionCallback0_0<
215  ReturnType>(
216  callback);
217 }
218 
219 
223 template <typename Class, typename Parent, typename ReturnType>
224 class MethodCallback0_0: public Parent {
225  public:
226  typedef ReturnType (Class::*Method)();
227  MethodCallback0_0(Class *object, Method callback):
228  Parent(),
229  m_object(object),
230  m_callback(callback) {}
231  ReturnType DoRun() {
232  return (m_object->*m_callback)();
233  }
234  private:
235  Class *m_object;
236  Method m_callback;
237 };
238 
239 
249 template <typename Class, typename ReturnType>
251  Class* object,
252  ReturnType (Class::*method)()) {
253  return new MethodCallback0_0<Class,
255  ReturnType>(
256  object,
257  method);
258 }
259 
260 
270 template <typename Class, typename ReturnType>
272  Class* object,
273  ReturnType (Class::*method)()) {
274  return new MethodCallback0_0<Class,
276  ReturnType>(
277  object,
278  method);
279 }
280 
281 
285 template <typename Parent, typename ReturnType, typename A0>
286 class FunctionCallback1_0: public Parent {
287  public:
288  typedef ReturnType (*Function)(A0);
289  FunctionCallback1_0(Function callback, A0 a0):
290  Parent(),
291  m_callback(callback),
292  m_a0(a0) {}
293  ReturnType DoRun() {
294  return m_callback(m_a0);
295  }
296  private:
297  Function m_callback;
298  A0 m_a0;
299 };
300 
301 
311 template <typename ReturnType, typename A0>
313  ReturnType (*callback)(A0),
314  A0 a0) {
315  return new FunctionCallback1_0<
317  ReturnType,
318  A0>(
319  callback,
320  a0);
321 }
322 
323 
333 template <typename ReturnType, typename A0>
335  ReturnType (*callback)(A0),
336  A0 a0) {
337  return new FunctionCallback1_0<
339  ReturnType,
340  A0>(
341  callback,
342  a0);
343 }
344 
345 
349 template <typename Class, typename Parent, typename ReturnType, typename A0>
350 class MethodCallback1_0: public Parent {
351  public:
352  typedef ReturnType (Class::*Method)(A0);
353  MethodCallback1_0(Class *object, Method callback, A0 a0):
354  Parent(),
355  m_object(object),
356  m_callback(callback),
357  m_a0(a0) {}
358  ReturnType DoRun() {
359  return (m_object->*m_callback)(m_a0);
360  }
361  private:
362  Class *m_object;
363  Method m_callback;
364  A0 m_a0;
365 };
366 
367 
379 template <typename Class, typename ReturnType, typename A0>
381  Class* object,
382  ReturnType (Class::*method)(A0),
383  A0 a0) {
384  return new MethodCallback1_0<Class,
386  ReturnType,
387  A0>(
388  object,
389  method,
390  a0);
391 }
392 
393 
405 template <typename Class, typename ReturnType, typename A0>
407  Class* object,
408  ReturnType (Class::*method)(A0),
409  A0 a0) {
410  return new MethodCallback1_0<Class,
412  ReturnType,
413  A0>(
414  object,
415  method,
416  a0);
417 }
418 
419 
423 template <typename Parent, typename ReturnType, typename A0, typename A1>
424 class FunctionCallback2_0: public Parent {
425  public:
426  typedef ReturnType (*Function)(A0, A1);
427  FunctionCallback2_0(Function callback, A0 a0, A1 a1):
428  Parent(),
429  m_callback(callback),
430  m_a0(a0),
431  m_a1(a1) {}
432  ReturnType DoRun() {
433  return m_callback(m_a0, m_a1);
434  }
435  private:
436  Function m_callback;
437  A0 m_a0;
438  A1 m_a1;
439 };
440 
441 
453 template <typename ReturnType, typename A0, typename A1>
455  ReturnType (*callback)(A0, A1),
456  A0 a0,
457  A1 a1) {
458  return new FunctionCallback2_0<
460  ReturnType,
461  A0,
462  A1>(
463  callback,
464  a0,
465  a1);
466 }
467 
468 
480 template <typename ReturnType, typename A0, typename A1>
482  ReturnType (*callback)(A0, A1),
483  A0 a0,
484  A1 a1) {
485  return new FunctionCallback2_0<
487  ReturnType,
488  A0,
489  A1>(
490  callback,
491  a0,
492  a1);
493 }
494 
495 
499 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1> // NOLINT(whitespace/line_length)
500 class MethodCallback2_0: public Parent {
501  public:
502  typedef ReturnType (Class::*Method)(A0, A1);
503  MethodCallback2_0(Class *object, Method callback, A0 a0, A1 a1):
504  Parent(),
505  m_object(object),
506  m_callback(callback),
507  m_a0(a0),
508  m_a1(a1) {}
509  ReturnType DoRun() {
510  return (m_object->*m_callback)(m_a0, m_a1);
511  }
512  private:
513  Class *m_object;
514  Method m_callback;
515  A0 m_a0;
516  A1 m_a1;
517 };
518 
519 
533 template <typename Class, typename ReturnType, typename A0, typename A1>
535  Class* object,
536  ReturnType (Class::*method)(A0, A1),
537  A0 a0,
538  A1 a1) {
539  return new MethodCallback2_0<Class,
541  ReturnType,
542  A0,
543  A1>(
544  object,
545  method,
546  a0,
547  a1);
548 }
549 
550 
564 template <typename Class, typename ReturnType, typename A0, typename A1>
566  Class* object,
567  ReturnType (Class::*method)(A0, A1),
568  A0 a0,
569  A1 a1) {
570  return new MethodCallback2_0<Class,
572  ReturnType,
573  A0,
574  A1>(
575  object,
576  method,
577  a0,
578  a1);
579 }
580 
581 
585 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2> // NOLINT(whitespace/line_length)
586 class FunctionCallback3_0: public Parent {
587  public:
588  typedef ReturnType (*Function)(A0, A1, A2);
589  FunctionCallback3_0(Function callback, A0 a0, A1 a1, A2 a2):
590  Parent(),
591  m_callback(callback),
592  m_a0(a0),
593  m_a1(a1),
594  m_a2(a2) {}
595  ReturnType DoRun() {
596  return m_callback(m_a0, m_a1, m_a2);
597  }
598  private:
599  Function m_callback;
600  A0 m_a0;
601  A1 m_a1;
602  A2 m_a2;
603 };
604 
605 
619 template <typename ReturnType, typename A0, typename A1, typename A2>
621  ReturnType (*callback)(A0, A1, A2),
622  A0 a0,
623  A1 a1,
624  A2 a2) {
625  return new FunctionCallback3_0<
627  ReturnType,
628  A0,
629  A1,
630  A2>(
631  callback,
632  a0,
633  a1,
634  a2);
635 }
636 
637 
651 template <typename ReturnType, typename A0, typename A1, typename A2>
653  ReturnType (*callback)(A0, A1, A2),
654  A0 a0,
655  A1 a1,
656  A2 a2) {
657  return new FunctionCallback3_0<
659  ReturnType,
660  A0,
661  A1,
662  A2>(
663  callback,
664  a0,
665  a1,
666  a2);
667 }
668 
669 
673 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2> // NOLINT(whitespace/line_length)
674 class MethodCallback3_0: public Parent {
675  public:
676  typedef ReturnType (Class::*Method)(A0, A1, A2);
677  MethodCallback3_0(Class *object, Method callback, A0 a0, A1 a1, A2 a2):
678  Parent(),
679  m_object(object),
680  m_callback(callback),
681  m_a0(a0),
682  m_a1(a1),
683  m_a2(a2) {}
684  ReturnType DoRun() {
685  return (m_object->*m_callback)(m_a0, m_a1, m_a2);
686  }
687  private:
688  Class *m_object;
689  Method m_callback;
690  A0 m_a0;
691  A1 m_a1;
692  A2 m_a2;
693 };
694 
695 
711 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2> // NOLINT(whitespace/line_length)
713  Class* object,
714  ReturnType (Class::*method)(A0, A1, A2),
715  A0 a0,
716  A1 a1,
717  A2 a2) {
718  return new MethodCallback3_0<Class,
720  ReturnType,
721  A0,
722  A1,
723  A2>(
724  object,
725  method,
726  a0,
727  a1,
728  a2);
729 }
730 
731 
747 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2> // NOLINT(whitespace/line_length)
749  Class* object,
750  ReturnType (Class::*method)(A0, A1, A2),
751  A0 a0,
752  A1 a1,
753  A2 a2) {
754  return new MethodCallback3_0<Class,
756  ReturnType,
757  A0,
758  A1,
759  A2>(
760  object,
761  method,
762  a0,
763  a1,
764  a2);
765 }
766 
767 
771 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3> // NOLINT(whitespace/line_length)
772 class FunctionCallback4_0: public Parent {
773  public:
774  typedef ReturnType (*Function)(A0, A1, A2, A3);
775  FunctionCallback4_0(Function callback, A0 a0, A1 a1, A2 a2, A3 a3):
776  Parent(),
777  m_callback(callback),
778  m_a0(a0),
779  m_a1(a1),
780  m_a2(a2),
781  m_a3(a3) {}
782  ReturnType DoRun() {
783  return m_callback(m_a0, m_a1, m_a2, m_a3);
784  }
785  private:
786  Function m_callback;
787  A0 m_a0;
788  A1 m_a1;
789  A2 m_a2;
790  A3 m_a3;
791 };
792 
793 
809 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3> // NOLINT(whitespace/line_length)
811  ReturnType (*callback)(A0, A1, A2, A3),
812  A0 a0,
813  A1 a1,
814  A2 a2,
815  A3 a3) {
816  return new FunctionCallback4_0<
818  ReturnType,
819  A0,
820  A1,
821  A2,
822  A3>(
823  callback,
824  a0,
825  a1,
826  a2,
827  a3);
828 }
829 
830 
846 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3> // NOLINT(whitespace/line_length)
848  ReturnType (*callback)(A0, A1, A2, A3),
849  A0 a0,
850  A1 a1,
851  A2 a2,
852  A3 a3) {
853  return new FunctionCallback4_0<
855  ReturnType,
856  A0,
857  A1,
858  A2,
859  A3>(
860  callback,
861  a0,
862  a1,
863  a2,
864  a3);
865 }
866 
867 
871 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3> // NOLINT(whitespace/line_length)
872 class MethodCallback4_0: public Parent {
873  public:
874  typedef ReturnType (Class::*Method)(A0, A1, A2, A3);
875  MethodCallback4_0(Class *object, Method callback, A0 a0, A1 a1, A2 a2, A3 a3): // NOLINT(whitespace/line_length)
876  Parent(),
877  m_object(object),
878  m_callback(callback),
879  m_a0(a0),
880  m_a1(a1),
881  m_a2(a2),
882  m_a3(a3) {}
883  ReturnType DoRun() {
884  return (m_object->*m_callback)(m_a0, m_a1, m_a2, m_a3);
885  }
886  private:
887  Class *m_object;
888  Method m_callback;
889  A0 m_a0;
890  A1 m_a1;
891  A2 m_a2;
892  A3 m_a3;
893 };
894 
895 
913 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3> // NOLINT(whitespace/line_length)
915  Class* object,
916  ReturnType (Class::*method)(A0, A1, A2, A3),
917  A0 a0,
918  A1 a1,
919  A2 a2,
920  A3 a3) {
921  return new MethodCallback4_0<Class,
923  ReturnType,
924  A0,
925  A1,
926  A2,
927  A3>(
928  object,
929  method,
930  a0,
931  a1,
932  a2,
933  a3);
934 }
935 
936 
954 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3> // NOLINT(whitespace/line_length)
956  Class* object,
957  ReturnType (Class::*method)(A0, A1, A2, A3),
958  A0 a0,
959  A1 a1,
960  A2 a2,
961  A3 a3) {
962  return new MethodCallback4_0<Class,
964  ReturnType,
965  A0,
966  A1,
967  A2,
968  A3>(
969  object,
970  method,
971  a0,
972  a1,
973  a2,
974  a3);
975 }
976 
977 
981 template <typename ReturnType, typename Arg0>
983  public:
984  virtual ~BaseCallback1() {}
985  virtual ReturnType Run(Arg0 arg0) = 0;
986 };
987 
991 template <typename ReturnType, typename Arg0>
992 class Callback1: public BaseCallback1<ReturnType, Arg0> {
993  public:
994  virtual ~Callback1() {}
995  ReturnType Run(Arg0 arg0) { return this->DoRun(arg0); }
996  private:
997  virtual ReturnType DoRun(Arg0 arg0) = 0;
998 };
999 
1003 template <typename ReturnType, typename Arg0>
1004 class SingleUseCallback1: public BaseCallback1<ReturnType, Arg0> {
1005  public:
1006  virtual ~SingleUseCallback1() {}
1007  ReturnType Run(Arg0 arg0) {
1008  ReturnType ret = this->DoRun(arg0);
1009  delete this;
1010  return ret;
1011  }
1012  private:
1013  virtual ReturnType DoRun(Arg0 arg0) = 0;
1014 };
1015 
1019 template <typename Arg0>
1020 class SingleUseCallback1<void, Arg0>: public BaseCallback1<void, Arg0> {
1021  public:
1022  virtual ~SingleUseCallback1() {}
1023  void Run(Arg0 arg0) {
1024  this->DoRun(arg0);
1025  delete this;
1026  }
1027  private:
1028  virtual void DoRun(Arg0 arg0) = 0;
1029 };
1030 
1034 template <typename Parent, typename ReturnType, typename Arg0>
1035 class FunctionCallback0_1: public Parent {
1036  public:
1037  typedef ReturnType (*Function)(Arg0);
1038  explicit FunctionCallback0_1(Function callback):
1039  Parent(),
1040  m_callback(callback) {}
1041  ReturnType DoRun(Arg0 arg0) {
1042  return m_callback(arg0);
1043  }
1044  private:
1045  Function m_callback;
1046 };
1047 
1048 
1057 template <typename ReturnType, typename Arg0>
1059  ReturnType (*callback)(Arg0)) {
1060  return new FunctionCallback0_1<
1062  ReturnType,
1063  Arg0>(
1064  callback);
1065 }
1066 
1067 
1076 template <typename ReturnType, typename Arg0>
1078  ReturnType (*callback)(Arg0)) {
1079  return new FunctionCallback0_1<
1081  ReturnType,
1082  Arg0>(
1083  callback);
1084 }
1085 
1086 
1090 template <typename Class, typename Parent, typename ReturnType, typename Arg0>
1091 class MethodCallback0_1: public Parent {
1092  public:
1093  typedef ReturnType (Class::*Method)(Arg0);
1094  MethodCallback0_1(Class *object, Method callback):
1095  Parent(),
1096  m_object(object),
1097  m_callback(callback) {}
1098  ReturnType DoRun(Arg0 arg0) {
1099  return (m_object->*m_callback)(arg0);
1100  }
1101  private:
1102  Class *m_object;
1103  Method m_callback;
1104 };
1105 
1106 
1117 template <typename Class, typename ReturnType, typename Arg0>
1119  Class* object,
1120  ReturnType (Class::*method)(Arg0)) {
1121  return new MethodCallback0_1<Class,
1123  ReturnType,
1124  Arg0>(
1125  object,
1126  method);
1127 }
1128 
1129 
1140 template <typename Class, typename ReturnType, typename Arg0>
1142  Class* object,
1143  ReturnType (Class::*method)(Arg0)) {
1144  return new MethodCallback0_1<Class,
1146  ReturnType,
1147  Arg0>(
1148  object,
1149  method);
1150 }
1151 
1152 
1156 template <typename Parent, typename ReturnType, typename A0, typename Arg0>
1157 class FunctionCallback1_1: public Parent {
1158  public:
1159  typedef ReturnType (*Function)(A0, Arg0);
1160  FunctionCallback1_1(Function callback, A0 a0):
1161  Parent(),
1162  m_callback(callback),
1163  m_a0(a0) {}
1164  ReturnType DoRun(Arg0 arg0) {
1165  return m_callback(m_a0, arg0);
1166  }
1167  private:
1168  Function m_callback;
1169  A0 m_a0;
1170 };
1171 
1172 
1183 template <typename ReturnType, typename A0, typename Arg0>
1185  ReturnType (*callback)(A0, Arg0),
1186  A0 a0) {
1187  return new FunctionCallback1_1<
1189  ReturnType,
1190  A0,
1191  Arg0>(
1192  callback,
1193  a0);
1194 }
1195 
1196 
1207 template <typename ReturnType, typename A0, typename Arg0>
1209  ReturnType (*callback)(A0, Arg0),
1210  A0 a0) {
1211  return new FunctionCallback1_1<
1213  ReturnType,
1214  A0,
1215  Arg0>(
1216  callback,
1217  a0);
1218 }
1219 
1220 
1224 template <typename Class, typename Parent, typename ReturnType, typename A0, typename Arg0> // NOLINT(whitespace/line_length)
1225 class MethodCallback1_1: public Parent {
1226  public:
1227  typedef ReturnType (Class::*Method)(A0, Arg0);
1228  MethodCallback1_1(Class *object, Method callback, A0 a0):
1229  Parent(),
1230  m_object(object),
1231  m_callback(callback),
1232  m_a0(a0) {}
1233  ReturnType DoRun(Arg0 arg0) {
1234  return (m_object->*m_callback)(m_a0, arg0);
1235  }
1236  private:
1237  Class *m_object;
1238  Method m_callback;
1239  A0 m_a0;
1240 };
1241 
1242 
1255 template <typename Class, typename ReturnType, typename A0, typename Arg0>
1257  Class* object,
1258  ReturnType (Class::*method)(A0, Arg0),
1259  A0 a0) {
1260  return new MethodCallback1_1<Class,
1262  ReturnType,
1263  A0,
1264  Arg0>(
1265  object,
1266  method,
1267  a0);
1268 }
1269 
1270 
1283 template <typename Class, typename ReturnType, typename A0, typename Arg0>
1285  Class* object,
1286  ReturnType (Class::*method)(A0, Arg0),
1287  A0 a0) {
1288  return new MethodCallback1_1<Class,
1290  ReturnType,
1291  A0,
1292  Arg0>(
1293  object,
1294  method,
1295  a0);
1296 }
1297 
1298 
1302 template <typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0> // NOLINT(whitespace/line_length)
1303 class FunctionCallback2_1: public Parent {
1304  public:
1305  typedef ReturnType (*Function)(A0, A1, Arg0);
1306  FunctionCallback2_1(Function callback, A0 a0, A1 a1):
1307  Parent(),
1308  m_callback(callback),
1309  m_a0(a0),
1310  m_a1(a1) {}
1311  ReturnType DoRun(Arg0 arg0) {
1312  return m_callback(m_a0, m_a1, arg0);
1313  }
1314  private:
1315  Function m_callback;
1316  A0 m_a0;
1317  A1 m_a1;
1318 };
1319 
1320 
1333 template <typename ReturnType, typename A0, typename A1, typename Arg0>
1335  ReturnType (*callback)(A0, A1, Arg0),
1336  A0 a0,
1337  A1 a1) {
1338  return new FunctionCallback2_1<
1340  ReturnType,
1341  A0,
1342  A1,
1343  Arg0>(
1344  callback,
1345  a0,
1346  a1);
1347 }
1348 
1349 
1362 template <typename ReturnType, typename A0, typename A1, typename Arg0>
1364  ReturnType (*callback)(A0, A1, Arg0),
1365  A0 a0,
1366  A1 a1) {
1367  return new FunctionCallback2_1<
1369  ReturnType,
1370  A0,
1371  A1,
1372  Arg0>(
1373  callback,
1374  a0,
1375  a1);
1376 }
1377 
1378 
1382 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0> // NOLINT(whitespace/line_length)
1383 class MethodCallback2_1: public Parent {
1384  public:
1385  typedef ReturnType (Class::*Method)(A0, A1, Arg0);
1386  MethodCallback2_1(Class *object, Method callback, A0 a0, A1 a1):
1387  Parent(),
1388  m_object(object),
1389  m_callback(callback),
1390  m_a0(a0),
1391  m_a1(a1) {}
1392  ReturnType DoRun(Arg0 arg0) {
1393  return (m_object->*m_callback)(m_a0, m_a1, arg0);
1394  }
1395  private:
1396  Class *m_object;
1397  Method m_callback;
1398  A0 m_a0;
1399  A1 m_a1;
1400 };
1401 
1402 
1417 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0> // NOLINT(whitespace/line_length)
1419  Class* object,
1420  ReturnType (Class::*method)(A0, A1, Arg0),
1421  A0 a0,
1422  A1 a1) {
1423  return new MethodCallback2_1<Class,
1425  ReturnType,
1426  A0,
1427  A1,
1428  Arg0>(
1429  object,
1430  method,
1431  a0,
1432  a1);
1433 }
1434 
1435 
1450 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0> // NOLINT(whitespace/line_length)
1452  Class* object,
1453  ReturnType (Class::*method)(A0, A1, Arg0),
1454  A0 a0,
1455  A1 a1) {
1456  return new MethodCallback2_1<Class,
1458  ReturnType,
1459  A0,
1460  A1,
1461  Arg0>(
1462  object,
1463  method,
1464  a0,
1465  a1);
1466 }
1467 
1468 
1472 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0> // NOLINT(whitespace/line_length)
1473 class FunctionCallback3_1: public Parent {
1474  public:
1475  typedef ReturnType (*Function)(A0, A1, A2, Arg0);
1476  FunctionCallback3_1(Function callback, A0 a0, A1 a1, A2 a2):
1477  Parent(),
1478  m_callback(callback),
1479  m_a0(a0),
1480  m_a1(a1),
1481  m_a2(a2) {}
1482  ReturnType DoRun(Arg0 arg0) {
1483  return m_callback(m_a0, m_a1, m_a2, arg0);
1484  }
1485  private:
1486  Function m_callback;
1487  A0 m_a0;
1488  A1 m_a1;
1489  A2 m_a2;
1490 };
1491 
1492 
1507 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0> // NOLINT(whitespace/line_length)
1509  ReturnType (*callback)(A0, A1, A2, Arg0),
1510  A0 a0,
1511  A1 a1,
1512  A2 a2) {
1513  return new FunctionCallback3_1<
1515  ReturnType,
1516  A0,
1517  A1,
1518  A2,
1519  Arg0>(
1520  callback,
1521  a0,
1522  a1,
1523  a2);
1524 }
1525 
1526 
1541 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0> // NOLINT(whitespace/line_length)
1543  ReturnType (*callback)(A0, A1, A2, Arg0),
1544  A0 a0,
1545  A1 a1,
1546  A2 a2) {
1547  return new FunctionCallback3_1<
1549  ReturnType,
1550  A0,
1551  A1,
1552  A2,
1553  Arg0>(
1554  callback,
1555  a0,
1556  a1,
1557  a2);
1558 }
1559 
1560 
1564 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0> // NOLINT(whitespace/line_length)
1565 class MethodCallback3_1: public Parent {
1566  public:
1567  typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0);
1568  MethodCallback3_1(Class *object, Method callback, A0 a0, A1 a1, A2 a2):
1569  Parent(),
1570  m_object(object),
1571  m_callback(callback),
1572  m_a0(a0),
1573  m_a1(a1),
1574  m_a2(a2) {}
1575  ReturnType DoRun(Arg0 arg0) {
1576  return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0);
1577  }
1578  private:
1579  Class *m_object;
1580  Method m_callback;
1581  A0 m_a0;
1582  A1 m_a1;
1583  A2 m_a2;
1584 };
1585 
1586 
1603 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0> // NOLINT(whitespace/line_length)
1605  Class* object,
1606  ReturnType (Class::*method)(A0, A1, A2, Arg0),
1607  A0 a0,
1608  A1 a1,
1609  A2 a2) {
1610  return new MethodCallback3_1<Class,
1612  ReturnType,
1613  A0,
1614  A1,
1615  A2,
1616  Arg0>(
1617  object,
1618  method,
1619  a0,
1620  a1,
1621  a2);
1622 }
1623 
1624 
1641 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0> // NOLINT(whitespace/line_length)
1643  Class* object,
1644  ReturnType (Class::*method)(A0, A1, A2, Arg0),
1645  A0 a0,
1646  A1 a1,
1647  A2 a2) {
1648  return new MethodCallback3_1<Class,
1650  ReturnType,
1651  A0,
1652  A1,
1653  A2,
1654  Arg0>(
1655  object,
1656  method,
1657  a0,
1658  a1,
1659  a2);
1660 }
1661 
1662 
1666 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0> // NOLINT(whitespace/line_length)
1667 class FunctionCallback4_1: public Parent {
1668  public:
1669  typedef ReturnType (*Function)(A0, A1, A2, A3, Arg0);
1670  FunctionCallback4_1(Function callback, A0 a0, A1 a1, A2 a2, A3 a3):
1671  Parent(),
1672  m_callback(callback),
1673  m_a0(a0),
1674  m_a1(a1),
1675  m_a2(a2),
1676  m_a3(a3) {}
1677  ReturnType DoRun(Arg0 arg0) {
1678  return m_callback(m_a0, m_a1, m_a2, m_a3, arg0);
1679  }
1680  private:
1681  Function m_callback;
1682  A0 m_a0;
1683  A1 m_a1;
1684  A2 m_a2;
1685  A3 m_a3;
1686 };
1687 
1688 
1705 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0> // NOLINT(whitespace/line_length)
1707  ReturnType (*callback)(A0, A1, A2, A3, Arg0),
1708  A0 a0,
1709  A1 a1,
1710  A2 a2,
1711  A3 a3) {
1712  return new FunctionCallback4_1<
1714  ReturnType,
1715  A0,
1716  A1,
1717  A2,
1718  A3,
1719  Arg0>(
1720  callback,
1721  a0,
1722  a1,
1723  a2,
1724  a3);
1725 }
1726 
1727 
1744 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0> // NOLINT(whitespace/line_length)
1746  ReturnType (*callback)(A0, A1, A2, A3, Arg0),
1747  A0 a0,
1748  A1 a1,
1749  A2 a2,
1750  A3 a3) {
1751  return new FunctionCallback4_1<
1753  ReturnType,
1754  A0,
1755  A1,
1756  A2,
1757  A3,
1758  Arg0>(
1759  callback,
1760  a0,
1761  a1,
1762  a2,
1763  a3);
1764 }
1765 
1766 
1770 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0> // NOLINT(whitespace/line_length)
1771 class MethodCallback4_1: public Parent {
1772  public:
1773  typedef ReturnType (Class::*Method)(A0, A1, A2, A3, Arg0);
1774  MethodCallback4_1(Class *object, Method callback, A0 a0, A1 a1, A2 a2, A3 a3): // NOLINT(whitespace/line_length)
1775  Parent(),
1776  m_object(object),
1777  m_callback(callback),
1778  m_a0(a0),
1779  m_a1(a1),
1780  m_a2(a2),
1781  m_a3(a3) {}
1782  ReturnType DoRun(Arg0 arg0) {
1783  return (m_object->*m_callback)(m_a0, m_a1, m_a2, m_a3, arg0);
1784  }
1785  private:
1786  Class *m_object;
1787  Method m_callback;
1788  A0 m_a0;
1789  A1 m_a1;
1790  A2 m_a2;
1791  A3 m_a3;
1792 };
1793 
1794 
1813 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0> // NOLINT(whitespace/line_length)
1815  Class* object,
1816  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0),
1817  A0 a0,
1818  A1 a1,
1819  A2 a2,
1820  A3 a3) {
1821  return new MethodCallback4_1<Class,
1823  ReturnType,
1824  A0,
1825  A1,
1826  A2,
1827  A3,
1828  Arg0>(
1829  object,
1830  method,
1831  a0,
1832  a1,
1833  a2,
1834  a3);
1835 }
1836 
1837 
1856 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0> // NOLINT(whitespace/line_length)
1858  Class* object,
1859  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0),
1860  A0 a0,
1861  A1 a1,
1862  A2 a2,
1863  A3 a3) {
1864  return new MethodCallback4_1<Class,
1866  ReturnType,
1867  A0,
1868  A1,
1869  A2,
1870  A3,
1871  Arg0>(
1872  object,
1873  method,
1874  a0,
1875  a1,
1876  a2,
1877  a3);
1878 }
1879 
1880 
1884 template <typename ReturnType, typename Arg0, typename Arg1>
1886  public:
1887  virtual ~BaseCallback2() {}
1888  virtual ReturnType Run(Arg0 arg0, Arg1 arg1) = 0;
1889 };
1890 
1894 template <typename ReturnType, typename Arg0, typename Arg1>
1895 class Callback2: public BaseCallback2<ReturnType, Arg0, Arg1> {
1896  public:
1897  virtual ~Callback2() {}
1898  ReturnType Run(Arg0 arg0, Arg1 arg1) { return this->DoRun(arg0, arg1); }
1899  private:
1900  virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1) = 0;
1901 };
1902 
1906 template <typename ReturnType, typename Arg0, typename Arg1>
1907 class SingleUseCallback2: public BaseCallback2<ReturnType, Arg0, Arg1> {
1908  public:
1909  virtual ~SingleUseCallback2() {}
1910  ReturnType Run(Arg0 arg0, Arg1 arg1) {
1911  ReturnType ret = this->DoRun(arg0, arg1);
1912  delete this;
1913  return ret;
1914  }
1915  private:
1916  virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1) = 0;
1917 };
1918 
1922 template <typename Arg0, typename Arg1>
1923 class SingleUseCallback2<void, Arg0, Arg1>: public BaseCallback2<void, Arg0, Arg1> { // NOLINT(whitespace/line_length)
1924  public:
1925  virtual ~SingleUseCallback2() {}
1926  void Run(Arg0 arg0, Arg1 arg1) {
1927  this->DoRun(arg0, arg1);
1928  delete this;
1929  }
1930  private:
1931  virtual void DoRun(Arg0 arg0, Arg1 arg1) = 0;
1932 };
1933 
1937 template <typename Parent, typename ReturnType, typename Arg0, typename Arg1>
1938 class FunctionCallback0_2: public Parent {
1939  public:
1940  typedef ReturnType (*Function)(Arg0, Arg1);
1941  explicit FunctionCallback0_2(Function callback):
1942  Parent(),
1943  m_callback(callback) {}
1944  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
1945  return m_callback(arg0, arg1);
1946  }
1947  private:
1948  Function m_callback;
1949 };
1950 
1951 
1961 template <typename ReturnType, typename Arg0, typename Arg1>
1963  ReturnType (*callback)(Arg0, Arg1)) {
1964  return new FunctionCallback0_2<
1966  ReturnType,
1967  Arg0,
1968  Arg1>(
1969  callback);
1970 }
1971 
1972 
1982 template <typename ReturnType, typename Arg0, typename Arg1>
1984  ReturnType (*callback)(Arg0, Arg1)) {
1985  return new FunctionCallback0_2<
1987  ReturnType,
1988  Arg0,
1989  Arg1>(
1990  callback);
1991 }
1992 
1993 
1997 template <typename Class, typename Parent, typename ReturnType, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
1998 class MethodCallback0_2: public Parent {
1999  public:
2000  typedef ReturnType (Class::*Method)(Arg0, Arg1);
2001  MethodCallback0_2(Class *object, Method callback):
2002  Parent(),
2003  m_object(object),
2004  m_callback(callback) {}
2005  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2006  return (m_object->*m_callback)(arg0, arg1);
2007  }
2008  private:
2009  Class *m_object;
2010  Method m_callback;
2011 };
2012 
2013 
2025 template <typename Class, typename ReturnType, typename Arg0, typename Arg1>
2027  Class* object,
2028  ReturnType (Class::*method)(Arg0, Arg1)) {
2029  return new MethodCallback0_2<Class,
2031  ReturnType,
2032  Arg0,
2033  Arg1>(
2034  object,
2035  method);
2036 }
2037 
2038 
2050 template <typename Class, typename ReturnType, typename Arg0, typename Arg1>
2052  Class* object,
2053  ReturnType (Class::*method)(Arg0, Arg1)) {
2054  return new MethodCallback0_2<Class,
2056  ReturnType,
2057  Arg0,
2058  Arg1>(
2059  object,
2060  method);
2061 }
2062 
2063 
2067 template <typename Parent, typename ReturnType, typename A0, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2068 class FunctionCallback1_2: public Parent {
2069  public:
2070  typedef ReturnType (*Function)(A0, Arg0, Arg1);
2071  FunctionCallback1_2(Function callback, A0 a0):
2072  Parent(),
2073  m_callback(callback),
2074  m_a0(a0) {}
2075  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2076  return m_callback(m_a0, arg0, arg1);
2077  }
2078  private:
2079  Function m_callback;
2080  A0 m_a0;
2081 };
2082 
2083 
2095 template <typename ReturnType, typename A0, typename Arg0, typename Arg1>
2097  ReturnType (*callback)(A0, Arg0, Arg1),
2098  A0 a0) {
2099  return new FunctionCallback1_2<
2101  ReturnType,
2102  A0,
2103  Arg0,
2104  Arg1>(
2105  callback,
2106  a0);
2107 }
2108 
2109 
2121 template <typename ReturnType, typename A0, typename Arg0, typename Arg1>
2123  ReturnType (*callback)(A0, Arg0, Arg1),
2124  A0 a0) {
2125  return new FunctionCallback1_2<
2127  ReturnType,
2128  A0,
2129  Arg0,
2130  Arg1>(
2131  callback,
2132  a0);
2133 }
2134 
2135 
2139 template <typename Class, typename Parent, typename ReturnType, typename A0, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2140 class MethodCallback1_2: public Parent {
2141  public:
2142  typedef ReturnType (Class::*Method)(A0, Arg0, Arg1);
2143  MethodCallback1_2(Class *object, Method callback, A0 a0):
2144  Parent(),
2145  m_object(object),
2146  m_callback(callback),
2147  m_a0(a0) {}
2148  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2149  return (m_object->*m_callback)(m_a0, arg0, arg1);
2150  }
2151  private:
2152  Class *m_object;
2153  Method m_callback;
2154  A0 m_a0;
2155 };
2156 
2157 
2171 template <typename Class, typename ReturnType, typename A0, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2173  Class* object,
2174  ReturnType (Class::*method)(A0, Arg0, Arg1),
2175  A0 a0) {
2176  return new MethodCallback1_2<Class,
2178  ReturnType,
2179  A0,
2180  Arg0,
2181  Arg1>(
2182  object,
2183  method,
2184  a0);
2185 }
2186 
2187 
2201 template <typename Class, typename ReturnType, typename A0, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2203  Class* object,
2204  ReturnType (Class::*method)(A0, Arg0, Arg1),
2205  A0 a0) {
2206  return new MethodCallback1_2<Class,
2208  ReturnType,
2209  A0,
2210  Arg0,
2211  Arg1>(
2212  object,
2213  method,
2214  a0);
2215 }
2216 
2217 
2221 template <typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2222 class FunctionCallback2_2: public Parent {
2223  public:
2224  typedef ReturnType (*Function)(A0, A1, Arg0, Arg1);
2225  FunctionCallback2_2(Function callback, A0 a0, A1 a1):
2226  Parent(),
2227  m_callback(callback),
2228  m_a0(a0),
2229  m_a1(a1) {}
2230  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2231  return m_callback(m_a0, m_a1, arg0, arg1);
2232  }
2233  private:
2234  Function m_callback;
2235  A0 m_a0;
2236  A1 m_a1;
2237 };
2238 
2239 
2253 template <typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2255  ReturnType (*callback)(A0, A1, Arg0, Arg1),
2256  A0 a0,
2257  A1 a1) {
2258  return new FunctionCallback2_2<
2260  ReturnType,
2261  A0,
2262  A1,
2263  Arg0,
2264  Arg1>(
2265  callback,
2266  a0,
2267  a1);
2268 }
2269 
2270 
2284 template <typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2286  ReturnType (*callback)(A0, A1, Arg0, Arg1),
2287  A0 a0,
2288  A1 a1) {
2289  return new FunctionCallback2_2<
2291  ReturnType,
2292  A0,
2293  A1,
2294  Arg0,
2295  Arg1>(
2296  callback,
2297  a0,
2298  a1);
2299 }
2300 
2301 
2305 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2306 class MethodCallback2_2: public Parent {
2307  public:
2308  typedef ReturnType (Class::*Method)(A0, A1, Arg0, Arg1);
2309  MethodCallback2_2(Class *object, Method callback, A0 a0, A1 a1):
2310  Parent(),
2311  m_object(object),
2312  m_callback(callback),
2313  m_a0(a0),
2314  m_a1(a1) {}
2315  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2316  return (m_object->*m_callback)(m_a0, m_a1, arg0, arg1);
2317  }
2318  private:
2319  Class *m_object;
2320  Method m_callback;
2321  A0 m_a0;
2322  A1 m_a1;
2323 };
2324 
2325 
2341 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2343  Class* object,
2344  ReturnType (Class::*method)(A0, A1, Arg0, Arg1),
2345  A0 a0,
2346  A1 a1) {
2347  return new MethodCallback2_2<Class,
2349  ReturnType,
2350  A0,
2351  A1,
2352  Arg0,
2353  Arg1>(
2354  object,
2355  method,
2356  a0,
2357  a1);
2358 }
2359 
2360 
2376 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2378  Class* object,
2379  ReturnType (Class::*method)(A0, A1, Arg0, Arg1),
2380  A0 a0,
2381  A1 a1) {
2382  return new MethodCallback2_2<Class,
2384  ReturnType,
2385  A0,
2386  A1,
2387  Arg0,
2388  Arg1>(
2389  object,
2390  method,
2391  a0,
2392  a1);
2393 }
2394 
2395 
2399 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2400 class FunctionCallback3_2: public Parent {
2401  public:
2402  typedef ReturnType (*Function)(A0, A1, A2, Arg0, Arg1);
2403  FunctionCallback3_2(Function callback, A0 a0, A1 a1, A2 a2):
2404  Parent(),
2405  m_callback(callback),
2406  m_a0(a0),
2407  m_a1(a1),
2408  m_a2(a2) {}
2409  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2410  return m_callback(m_a0, m_a1, m_a2, arg0, arg1);
2411  }
2412  private:
2413  Function m_callback;
2414  A0 m_a0;
2415  A1 m_a1;
2416  A2 m_a2;
2417 };
2418 
2419 
2435 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2437  ReturnType (*callback)(A0, A1, A2, Arg0, Arg1),
2438  A0 a0,
2439  A1 a1,
2440  A2 a2) {
2441  return new FunctionCallback3_2<
2443  ReturnType,
2444  A0,
2445  A1,
2446  A2,
2447  Arg0,
2448  Arg1>(
2449  callback,
2450  a0,
2451  a1,
2452  a2);
2453 }
2454 
2455 
2471 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2473  ReturnType (*callback)(A0, A1, A2, Arg0, Arg1),
2474  A0 a0,
2475  A1 a1,
2476  A2 a2) {
2477  return new FunctionCallback3_2<
2479  ReturnType,
2480  A0,
2481  A1,
2482  A2,
2483  Arg0,
2484  Arg1>(
2485  callback,
2486  a0,
2487  a1,
2488  a2);
2489 }
2490 
2491 
2495 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2496 class MethodCallback3_2: public Parent {
2497  public:
2498  typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0, Arg1);
2499  MethodCallback3_2(Class *object, Method callback, A0 a0, A1 a1, A2 a2):
2500  Parent(),
2501  m_object(object),
2502  m_callback(callback),
2503  m_a0(a0),
2504  m_a1(a1),
2505  m_a2(a2) {}
2506  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2507  return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0, arg1);
2508  }
2509  private:
2510  Class *m_object;
2511  Method m_callback;
2512  A0 m_a0;
2513  A1 m_a1;
2514  A2 m_a2;
2515 };
2516 
2517 
2535 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2537  Class* object,
2538  ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1),
2539  A0 a0,
2540  A1 a1,
2541  A2 a2) {
2542  return new MethodCallback3_2<Class,
2544  ReturnType,
2545  A0,
2546  A1,
2547  A2,
2548  Arg0,
2549  Arg1>(
2550  object,
2551  method,
2552  a0,
2553  a1,
2554  a2);
2555 }
2556 
2557 
2575 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2577  Class* object,
2578  ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1),
2579  A0 a0,
2580  A1 a1,
2581  A2 a2) {
2582  return new MethodCallback3_2<Class,
2584  ReturnType,
2585  A0,
2586  A1,
2587  A2,
2588  Arg0,
2589  Arg1>(
2590  object,
2591  method,
2592  a0,
2593  a1,
2594  a2);
2595 }
2596 
2597 
2601 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2602 class FunctionCallback4_2: public Parent {
2603  public:
2604  typedef ReturnType (*Function)(A0, A1, A2, A3, Arg0, Arg1);
2605  FunctionCallback4_2(Function callback, A0 a0, A1 a1, A2 a2, A3 a3):
2606  Parent(),
2607  m_callback(callback),
2608  m_a0(a0),
2609  m_a1(a1),
2610  m_a2(a2),
2611  m_a3(a3) {}
2612  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2613  return m_callback(m_a0, m_a1, m_a2, m_a3, arg0, arg1);
2614  }
2615  private:
2616  Function m_callback;
2617  A0 m_a0;
2618  A1 m_a1;
2619  A2 m_a2;
2620  A3 m_a3;
2621 };
2622 
2623 
2641 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2643  ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1),
2644  A0 a0,
2645  A1 a1,
2646  A2 a2,
2647  A3 a3) {
2648  return new FunctionCallback4_2<
2650  ReturnType,
2651  A0,
2652  A1,
2653  A2,
2654  A3,
2655  Arg0,
2656  Arg1>(
2657  callback,
2658  a0,
2659  a1,
2660  a2,
2661  a3);
2662 }
2663 
2664 
2682 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2684  ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1),
2685  A0 a0,
2686  A1 a1,
2687  A2 a2,
2688  A3 a3) {
2689  return new FunctionCallback4_2<
2691  ReturnType,
2692  A0,
2693  A1,
2694  A2,
2695  A3,
2696  Arg0,
2697  Arg1>(
2698  callback,
2699  a0,
2700  a1,
2701  a2,
2702  a3);
2703 }
2704 
2705 
2709 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2710 class MethodCallback4_2: public Parent {
2711  public:
2712  typedef ReturnType (Class::*Method)(A0, A1, A2, A3, Arg0, Arg1);
2713  MethodCallback4_2(Class *object, Method callback, A0 a0, A1 a1, A2 a2, A3 a3): // NOLINT(whitespace/line_length)
2714  Parent(),
2715  m_object(object),
2716  m_callback(callback),
2717  m_a0(a0),
2718  m_a1(a1),
2719  m_a2(a2),
2720  m_a3(a3) {}
2721  ReturnType DoRun(Arg0 arg0, Arg1 arg1) {
2722  return (m_object->*m_callback)(m_a0, m_a1, m_a2, m_a3, arg0, arg1);
2723  }
2724  private:
2725  Class *m_object;
2726  Method m_callback;
2727  A0 m_a0;
2728  A1 m_a1;
2729  A2 m_a2;
2730  A3 m_a3;
2731 };
2732 
2733 
2753 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2755  Class* object,
2756  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1),
2757  A0 a0,
2758  A1 a1,
2759  A2 a2,
2760  A3 a3) {
2761  return new MethodCallback4_2<Class,
2763  ReturnType,
2764  A0,
2765  A1,
2766  A2,
2767  A3,
2768  Arg0,
2769  Arg1>(
2770  object,
2771  method,
2772  a0,
2773  a1,
2774  a2,
2775  a3);
2776 }
2777 
2778 
2798 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1> // NOLINT(whitespace/line_length)
2800  Class* object,
2801  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1),
2802  A0 a0,
2803  A1 a1,
2804  A2 a2,
2805  A3 a3) {
2806  return new MethodCallback4_2<Class,
2808  ReturnType,
2809  A0,
2810  A1,
2811  A2,
2812  A3,
2813  Arg0,
2814  Arg1>(
2815  object,
2816  method,
2817  a0,
2818  a1,
2819  a2,
2820  a3);
2821 }
2822 
2823 
2827 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2>
2829  public:
2830  virtual ~BaseCallback3() {}
2831  virtual ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) = 0;
2832 };
2833 
2837 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2>
2838 class Callback3: public BaseCallback3<ReturnType, Arg0, Arg1, Arg2> {
2839  public:
2840  virtual ~Callback3() {}
2841  ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) { return this->DoRun(arg0, arg1, arg2); } // NOLINT(whitespace/line_length)
2842  private:
2843  virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) = 0;
2844 };
2845 
2849 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2>
2850 class SingleUseCallback3: public BaseCallback3<ReturnType, Arg0, Arg1, Arg2> {
2851  public:
2852  virtual ~SingleUseCallback3() {}
2853  ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
2854  ReturnType ret = this->DoRun(arg0, arg1, arg2);
2855  delete this;
2856  return ret;
2857  }
2858  private:
2859  virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) = 0;
2860 };
2861 
2865 template <typename Arg0, typename Arg1, typename Arg2>
2866 class SingleUseCallback3<void, Arg0, Arg1, Arg2>: public BaseCallback3<void, Arg0, Arg1, Arg2> { // NOLINT(whitespace/line_length)
2867  public:
2868  virtual ~SingleUseCallback3() {}
2869  void Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
2870  this->DoRun(arg0, arg1, arg2);
2871  delete this;
2872  }
2873  private:
2874  virtual void DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) = 0;
2875 };
2876 
2880 template <typename Parent, typename ReturnType, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
2881 class FunctionCallback0_3: public Parent {
2882  public:
2883  typedef ReturnType (*Function)(Arg0, Arg1, Arg2);
2884  explicit FunctionCallback0_3(Function callback):
2885  Parent(),
2886  m_callback(callback) {}
2887  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
2888  return m_callback(arg0, arg1, arg2);
2889  }
2890  private:
2891  Function m_callback;
2892 };
2893 
2894 
2905 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2>
2907  ReturnType (*callback)(Arg0, Arg1, Arg2)) {
2908  return new FunctionCallback0_3<
2910  ReturnType,
2911  Arg0,
2912  Arg1,
2913  Arg2>(
2914  callback);
2915 }
2916 
2917 
2928 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2>
2930  ReturnType (*callback)(Arg0, Arg1, Arg2)) {
2931  return new FunctionCallback0_3<
2933  ReturnType,
2934  Arg0,
2935  Arg1,
2936  Arg2>(
2937  callback);
2938 }
2939 
2940 
2944 template <typename Class, typename Parent, typename ReturnType, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
2945 class MethodCallback0_3: public Parent {
2946  public:
2947  typedef ReturnType (Class::*Method)(Arg0, Arg1, Arg2);
2948  MethodCallback0_3(Class *object, Method callback):
2949  Parent(),
2950  m_object(object),
2951  m_callback(callback) {}
2952  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
2953  return (m_object->*m_callback)(arg0, arg1, arg2);
2954  }
2955  private:
2956  Class *m_object;
2957  Method m_callback;
2958 };
2959 
2960 
2973 template <typename Class, typename ReturnType, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
2975  Class* object,
2976  ReturnType (Class::*method)(Arg0, Arg1, Arg2)) {
2977  return new MethodCallback0_3<Class,
2979  ReturnType,
2980  Arg0,
2981  Arg1,
2982  Arg2>(
2983  object,
2984  method);
2985 }
2986 
2987 
3000 template <typename Class, typename ReturnType, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3002  Class* object,
3003  ReturnType (Class::*method)(Arg0, Arg1, Arg2)) {
3004  return new MethodCallback0_3<Class,
3006  ReturnType,
3007  Arg0,
3008  Arg1,
3009  Arg2>(
3010  object,
3011  method);
3012 }
3013 
3014 
3018 template <typename Parent, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3019 class FunctionCallback1_3: public Parent {
3020  public:
3021  typedef ReturnType (*Function)(A0, Arg0, Arg1, Arg2);
3022  FunctionCallback1_3(Function callback, A0 a0):
3023  Parent(),
3024  m_callback(callback),
3025  m_a0(a0) {}
3026  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3027  return m_callback(m_a0, arg0, arg1, arg2);
3028  }
3029  private:
3030  Function m_callback;
3031  A0 m_a0;
3032 };
3033 
3034 
3047 template <typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3049  ReturnType (*callback)(A0, Arg0, Arg1, Arg2),
3050  A0 a0) {
3051  return new FunctionCallback1_3<
3053  ReturnType,
3054  A0,
3055  Arg0,
3056  Arg1,
3057  Arg2>(
3058  callback,
3059  a0);
3060 }
3061 
3062 
3075 template <typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3077  ReturnType (*callback)(A0, Arg0, Arg1, Arg2),
3078  A0 a0) {
3079  return new FunctionCallback1_3<
3081  ReturnType,
3082  A0,
3083  Arg0,
3084  Arg1,
3085  Arg2>(
3086  callback,
3087  a0);
3088 }
3089 
3090 
3094 template <typename Class, typename Parent, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3095 class MethodCallback1_3: public Parent {
3096  public:
3097  typedef ReturnType (Class::*Method)(A0, Arg0, Arg1, Arg2);
3098  MethodCallback1_3(Class *object, Method callback, A0 a0):
3099  Parent(),
3100  m_object(object),
3101  m_callback(callback),
3102  m_a0(a0) {}
3103  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3104  return (m_object->*m_callback)(m_a0, arg0, arg1, arg2);
3105  }
3106  private:
3107  Class *m_object;
3108  Method m_callback;
3109  A0 m_a0;
3110 };
3111 
3112 
3127 template <typename Class, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3129  Class* object,
3130  ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2),
3131  A0 a0) {
3132  return new MethodCallback1_3<Class,
3134  ReturnType,
3135  A0,
3136  Arg0,
3137  Arg1,
3138  Arg2>(
3139  object,
3140  method,
3141  a0);
3142 }
3143 
3144 
3159 template <typename Class, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3161  Class* object,
3162  ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2),
3163  A0 a0) {
3164  return new MethodCallback1_3<Class,
3166  ReturnType,
3167  A0,
3168  Arg0,
3169  Arg1,
3170  Arg2>(
3171  object,
3172  method,
3173  a0);
3174 }
3175 
3176 
3180 template <typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3181 class FunctionCallback2_3: public Parent {
3182  public:
3183  typedef ReturnType (*Function)(A0, A1, Arg0, Arg1, Arg2);
3184  FunctionCallback2_3(Function callback, A0 a0, A1 a1):
3185  Parent(),
3186  m_callback(callback),
3187  m_a0(a0),
3188  m_a1(a1) {}
3189  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3190  return m_callback(m_a0, m_a1, arg0, arg1, arg2);
3191  }
3192  private:
3193  Function m_callback;
3194  A0 m_a0;
3195  A1 m_a1;
3196 };
3197 
3198 
3213 template <typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3215  ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2),
3216  A0 a0,
3217  A1 a1) {
3218  return new FunctionCallback2_3<
3220  ReturnType,
3221  A0,
3222  A1,
3223  Arg0,
3224  Arg1,
3225  Arg2>(
3226  callback,
3227  a0,
3228  a1);
3229 }
3230 
3231 
3246 template <typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3248  ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2),
3249  A0 a0,
3250  A1 a1) {
3251  return new FunctionCallback2_3<
3253  ReturnType,
3254  A0,
3255  A1,
3256  Arg0,
3257  Arg1,
3258  Arg2>(
3259  callback,
3260  a0,
3261  a1);
3262 }
3263 
3264 
3268 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3269 class MethodCallback2_3: public Parent {
3270  public:
3271  typedef ReturnType (Class::*Method)(A0, A1, Arg0, Arg1, Arg2);
3272  MethodCallback2_3(Class *object, Method callback, A0 a0, A1 a1):
3273  Parent(),
3274  m_object(object),
3275  m_callback(callback),
3276  m_a0(a0),
3277  m_a1(a1) {}
3278  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3279  return (m_object->*m_callback)(m_a0, m_a1, arg0, arg1, arg2);
3280  }
3281  private:
3282  Class *m_object;
3283  Method m_callback;
3284  A0 m_a0;
3285  A1 m_a1;
3286 };
3287 
3288 
3305 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3307  Class* object,
3308  ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2),
3309  A0 a0,
3310  A1 a1) {
3311  return new MethodCallback2_3<Class,
3313  ReturnType,
3314  A0,
3315  A1,
3316  Arg0,
3317  Arg1,
3318  Arg2>(
3319  object,
3320  method,
3321  a0,
3322  a1);
3323 }
3324 
3325 
3342 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3344  Class* object,
3345  ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2),
3346  A0 a0,
3347  A1 a1) {
3348  return new MethodCallback2_3<Class,
3350  ReturnType,
3351  A0,
3352  A1,
3353  Arg0,
3354  Arg1,
3355  Arg2>(
3356  object,
3357  method,
3358  a0,
3359  a1);
3360 }
3361 
3362 
3366 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3367 class FunctionCallback3_3: public Parent {
3368  public:
3369  typedef ReturnType (*Function)(A0, A1, A2, Arg0, Arg1, Arg2);
3370  FunctionCallback3_3(Function callback, A0 a0, A1 a1, A2 a2):
3371  Parent(),
3372  m_callback(callback),
3373  m_a0(a0),
3374  m_a1(a1),
3375  m_a2(a2) {}
3376  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3377  return m_callback(m_a0, m_a1, m_a2, arg0, arg1, arg2);
3378  }
3379  private:
3380  Function m_callback;
3381  A0 m_a0;
3382  A1 m_a1;
3383  A2 m_a2;
3384 };
3385 
3386 
3403 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3405  ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2),
3406  A0 a0,
3407  A1 a1,
3408  A2 a2) {
3409  return new FunctionCallback3_3<
3411  ReturnType,
3412  A0,
3413  A1,
3414  A2,
3415  Arg0,
3416  Arg1,
3417  Arg2>(
3418  callback,
3419  a0,
3420  a1,
3421  a2);
3422 }
3423 
3424 
3441 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3443  ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2),
3444  A0 a0,
3445  A1 a1,
3446  A2 a2) {
3447  return new FunctionCallback3_3<
3449  ReturnType,
3450  A0,
3451  A1,
3452  A2,
3453  Arg0,
3454  Arg1,
3455  Arg2>(
3456  callback,
3457  a0,
3458  a1,
3459  a2);
3460 }
3461 
3462 
3466 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3467 class MethodCallback3_3: public Parent {
3468  public:
3469  typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0, Arg1, Arg2);
3470  MethodCallback3_3(Class *object, Method callback, A0 a0, A1 a1, A2 a2):
3471  Parent(),
3472  m_object(object),
3473  m_callback(callback),
3474  m_a0(a0),
3475  m_a1(a1),
3476  m_a2(a2) {}
3477  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3478  return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0, arg1, arg2);
3479  }
3480  private:
3481  Class *m_object;
3482  Method m_callback;
3483  A0 m_a0;
3484  A1 m_a1;
3485  A2 m_a2;
3486 };
3487 
3488 
3507 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3509  Class* object,
3510  ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2),
3511  A0 a0,
3512  A1 a1,
3513  A2 a2) {
3514  return new MethodCallback3_3<Class,
3516  ReturnType,
3517  A0,
3518  A1,
3519  A2,
3520  Arg0,
3521  Arg1,
3522  Arg2>(
3523  object,
3524  method,
3525  a0,
3526  a1,
3527  a2);
3528 }
3529 
3530 
3549 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3551  Class* object,
3552  ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2),
3553  A0 a0,
3554  A1 a1,
3555  A2 a2) {
3556  return new MethodCallback3_3<Class,
3558  ReturnType,
3559  A0,
3560  A1,
3561  A2,
3562  Arg0,
3563  Arg1,
3564  Arg2>(
3565  object,
3566  method,
3567  a0,
3568  a1,
3569  a2);
3570 }
3571 
3572 
3576 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3577 class FunctionCallback4_3: public Parent {
3578  public:
3579  typedef ReturnType (*Function)(A0, A1, A2, A3, Arg0, Arg1, Arg2);
3580  FunctionCallback4_3(Function callback, A0 a0, A1 a1, A2 a2, A3 a3):
3581  Parent(),
3582  m_callback(callback),
3583  m_a0(a0),
3584  m_a1(a1),
3585  m_a2(a2),
3586  m_a3(a3) {}
3587  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3588  return m_callback(m_a0, m_a1, m_a2, m_a3, arg0, arg1, arg2);
3589  }
3590  private:
3591  Function m_callback;
3592  A0 m_a0;
3593  A1 m_a1;
3594  A2 m_a2;
3595  A3 m_a3;
3596 };
3597 
3598 
3617 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3619  ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1, Arg2),
3620  A0 a0,
3621  A1 a1,
3622  A2 a2,
3623  A3 a3) {
3624  return new FunctionCallback4_3<
3626  ReturnType,
3627  A0,
3628  A1,
3629  A2,
3630  A3,
3631  Arg0,
3632  Arg1,
3633  Arg2>(
3634  callback,
3635  a0,
3636  a1,
3637  a2,
3638  a3);
3639 }
3640 
3641 
3660 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3662  ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1, Arg2),
3663  A0 a0,
3664  A1 a1,
3665  A2 a2,
3666  A3 a3) {
3667  return new FunctionCallback4_3<
3669  ReturnType,
3670  A0,
3671  A1,
3672  A2,
3673  A3,
3674  Arg0,
3675  Arg1,
3676  Arg2>(
3677  callback,
3678  a0,
3679  a1,
3680  a2,
3681  a3);
3682 }
3683 
3684 
3688 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3689 class MethodCallback4_3: public Parent {
3690  public:
3691  typedef ReturnType (Class::*Method)(A0, A1, A2, A3, Arg0, Arg1, Arg2);
3692  MethodCallback4_3(Class *object, Method callback, A0 a0, A1 a1, A2 a2, A3 a3): // NOLINT(whitespace/line_length)
3693  Parent(),
3694  m_object(object),
3695  m_callback(callback),
3696  m_a0(a0),
3697  m_a1(a1),
3698  m_a2(a2),
3699  m_a3(a3) {}
3700  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) {
3701  return (m_object->*m_callback)(m_a0, m_a1, m_a2, m_a3, arg0, arg1, arg2);
3702  }
3703  private:
3704  Class *m_object;
3705  Method m_callback;
3706  A0 m_a0;
3707  A1 m_a1;
3708  A2 m_a2;
3709  A3 m_a3;
3710 };
3711 
3712 
3733 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3735  Class* object,
3736  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1, Arg2),
3737  A0 a0,
3738  A1 a1,
3739  A2 a2,
3740  A3 a3) {
3741  return new MethodCallback4_3<Class,
3743  ReturnType,
3744  A0,
3745  A1,
3746  A2,
3747  A3,
3748  Arg0,
3749  Arg1,
3750  Arg2>(
3751  object,
3752  method,
3753  a0,
3754  a1,
3755  a2,
3756  a3);
3757 }
3758 
3759 
3780 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2> // NOLINT(whitespace/line_length)
3782  Class* object,
3783  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1, Arg2),
3784  A0 a0,
3785  A1 a1,
3786  A2 a2,
3787  A3 a3) {
3788  return new MethodCallback4_3<Class,
3790  ReturnType,
3791  A0,
3792  A1,
3793  A2,
3794  A3,
3795  Arg0,
3796  Arg1,
3797  Arg2>(
3798  object,
3799  method,
3800  a0,
3801  a1,
3802  a2,
3803  a3);
3804 }
3805 
3806 
3810 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3812  public:
3813  virtual ~BaseCallback4() {}
3814  virtual ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) = 0;
3815 };
3816 
3820 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3821 class Callback4: public BaseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3> {
3822  public:
3823  virtual ~Callback4() {}
3824  ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { return this->DoRun(arg0, arg1, arg2, arg3); } // NOLINT(whitespace/line_length)
3825  private:
3826  virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) = 0;
3827 };
3828 
3832 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3833 class SingleUseCallback4: public BaseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3> { // NOLINT(whitespace/line_length)
3834  public:
3835  virtual ~SingleUseCallback4() {}
3836  ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
3837  ReturnType ret = this->DoRun(arg0, arg1, arg2, arg3);
3838  delete this;
3839  return ret;
3840  }
3841  private:
3842  virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) = 0;
3843 };
3844 
3848 template <typename Arg0, typename Arg1, typename Arg2, typename Arg3>
3849 class SingleUseCallback4<void, Arg0, Arg1, Arg2, Arg3>: public BaseCallback4<void, Arg0, Arg1, Arg2, Arg3> { // NOLINT(whitespace/line_length)
3850  public:
3851  virtual ~SingleUseCallback4() {}
3852  void Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
3853  this->DoRun(arg0, arg1, arg2, arg3);
3854  delete this;
3855  }
3856  private:
3857  virtual void DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) = 0;
3858 };
3859 
3863 template <typename Parent, typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3864 class FunctionCallback0_4: public Parent {
3865  public:
3866  typedef ReturnType (*Function)(Arg0, Arg1, Arg2, Arg3);
3867  explicit FunctionCallback0_4(Function callback):
3868  Parent(),
3869  m_callback(callback) {}
3870  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
3871  return m_callback(arg0, arg1, arg2, arg3);
3872  }
3873  private:
3874  Function m_callback;
3875 };
3876 
3877 
3889 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3891  ReturnType (*callback)(Arg0, Arg1, Arg2, Arg3)) {
3892  return new FunctionCallback0_4<
3893  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
3894  ReturnType,
3895  Arg0,
3896  Arg1,
3897  Arg2,
3898  Arg3>(
3899  callback);
3900 }
3901 
3902 
3914 template <typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3916  ReturnType (*callback)(Arg0, Arg1, Arg2, Arg3)) {
3917  return new FunctionCallback0_4<
3919  ReturnType,
3920  Arg0,
3921  Arg1,
3922  Arg2,
3923  Arg3>(
3924  callback);
3925 }
3926 
3927 
3931 template <typename Class, typename Parent, typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3932 class MethodCallback0_4: public Parent {
3933  public:
3934  typedef ReturnType (Class::*Method)(Arg0, Arg1, Arg2, Arg3);
3935  MethodCallback0_4(Class *object, Method callback):
3936  Parent(),
3937  m_object(object),
3938  m_callback(callback) {}
3939  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
3940  return (m_object->*m_callback)(arg0, arg1, arg2, arg3);
3941  }
3942  private:
3943  Class *m_object;
3944  Method m_callback;
3945 };
3946 
3947 
3961 template <typename Class, typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3963  Class* object,
3964  ReturnType (Class::*method)(Arg0, Arg1, Arg2, Arg3)) {
3965  return new MethodCallback0_4<Class,
3966  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
3967  ReturnType,
3968  Arg0,
3969  Arg1,
3970  Arg2,
3971  Arg3>(
3972  object,
3973  method);
3974 }
3975 
3976 
3990 template <typename Class, typename ReturnType, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
3992  Class* object,
3993  ReturnType (Class::*method)(Arg0, Arg1, Arg2, Arg3)) {
3994  return new MethodCallback0_4<Class,
3996  ReturnType,
3997  Arg0,
3998  Arg1,
3999  Arg2,
4000  Arg3>(
4001  object,
4002  method);
4003 }
4004 
4005 
4009 template <typename Parent, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4010 class FunctionCallback1_4: public Parent {
4011  public:
4012  typedef ReturnType (*Function)(A0, Arg0, Arg1, Arg2, Arg3);
4013  FunctionCallback1_4(Function callback, A0 a0):
4014  Parent(),
4015  m_callback(callback),
4016  m_a0(a0) {}
4017  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4018  return m_callback(m_a0, arg0, arg1, arg2, arg3);
4019  }
4020  private:
4021  Function m_callback;
4022  A0 m_a0;
4023 };
4024 
4025 
4039 template <typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4041  ReturnType (*callback)(A0, Arg0, Arg1, Arg2, Arg3),
4042  A0 a0) {
4043  return new FunctionCallback1_4<
4044  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4045  ReturnType,
4046  A0,
4047  Arg0,
4048  Arg1,
4049  Arg2,
4050  Arg3>(
4051  callback,
4052  a0);
4053 }
4054 
4055 
4069 template <typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4071  ReturnType (*callback)(A0, Arg0, Arg1, Arg2, Arg3),
4072  A0 a0) {
4073  return new FunctionCallback1_4<
4075  ReturnType,
4076  A0,
4077  Arg0,
4078  Arg1,
4079  Arg2,
4080  Arg3>(
4081  callback,
4082  a0);
4083 }
4084 
4085 
4089 template <typename Class, typename Parent, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4090 class MethodCallback1_4: public Parent {
4091  public:
4092  typedef ReturnType (Class::*Method)(A0, Arg0, Arg1, Arg2, Arg3);
4093  MethodCallback1_4(Class *object, Method callback, A0 a0):
4094  Parent(),
4095  m_object(object),
4096  m_callback(callback),
4097  m_a0(a0) {}
4098  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4099  return (m_object->*m_callback)(m_a0, arg0, arg1, arg2, arg3);
4100  }
4101  private:
4102  Class *m_object;
4103  Method m_callback;
4104  A0 m_a0;
4105 };
4106 
4107 
4123 template <typename Class, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4125  Class* object,
4126  ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2, Arg3),
4127  A0 a0) {
4128  return new MethodCallback1_4<Class,
4129  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4130  ReturnType,
4131  A0,
4132  Arg0,
4133  Arg1,
4134  Arg2,
4135  Arg3>(
4136  object,
4137  method,
4138  a0);
4139 }
4140 
4141 
4157 template <typename Class, typename ReturnType, typename A0, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4159  Class* object,
4160  ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2, Arg3),
4161  A0 a0) {
4162  return new MethodCallback1_4<Class,
4164  ReturnType,
4165  A0,
4166  Arg0,
4167  Arg1,
4168  Arg2,
4169  Arg3>(
4170  object,
4171  method,
4172  a0);
4173 }
4174 
4175 
4179 template <typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4180 class FunctionCallback2_4: public Parent {
4181  public:
4182  typedef ReturnType (*Function)(A0, A1, Arg0, Arg1, Arg2, Arg3);
4183  FunctionCallback2_4(Function callback, A0 a0, A1 a1):
4184  Parent(),
4185  m_callback(callback),
4186  m_a0(a0),
4187  m_a1(a1) {}
4188  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4189  return m_callback(m_a0, m_a1, arg0, arg1, arg2, arg3);
4190  }
4191  private:
4192  Function m_callback;
4193  A0 m_a0;
4194  A1 m_a1;
4195 };
4196 
4197 
4213 template <typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4215  ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2, Arg3),
4216  A0 a0,
4217  A1 a1) {
4218  return new FunctionCallback2_4<
4219  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4220  ReturnType,
4221  A0,
4222  A1,
4223  Arg0,
4224  Arg1,
4225  Arg2,
4226  Arg3>(
4227  callback,
4228  a0,
4229  a1);
4230 }
4231 
4232 
4248 template <typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4250  ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2, Arg3),
4251  A0 a0,
4252  A1 a1) {
4253  return new FunctionCallback2_4<
4255  ReturnType,
4256  A0,
4257  A1,
4258  Arg0,
4259  Arg1,
4260  Arg2,
4261  Arg3>(
4262  callback,
4263  a0,
4264  a1);
4265 }
4266 
4267 
4271 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4272 class MethodCallback2_4: public Parent {
4273  public:
4274  typedef ReturnType (Class::*Method)(A0, A1, Arg0, Arg1, Arg2, Arg3);
4275  MethodCallback2_4(Class *object, Method callback, A0 a0, A1 a1):
4276  Parent(),
4277  m_object(object),
4278  m_callback(callback),
4279  m_a0(a0),
4280  m_a1(a1) {}
4281  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4282  return (m_object->*m_callback)(m_a0, m_a1, arg0, arg1, arg2, arg3);
4283  }
4284  private:
4285  Class *m_object;
4286  Method m_callback;
4287  A0 m_a0;
4288  A1 m_a1;
4289 };
4290 
4291 
4309 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4311  Class* object,
4312  ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2, Arg3),
4313  A0 a0,
4314  A1 a1) {
4315  return new MethodCallback2_4<Class,
4316  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4317  ReturnType,
4318  A0,
4319  A1,
4320  Arg0,
4321  Arg1,
4322  Arg2,
4323  Arg3>(
4324  object,
4325  method,
4326  a0,
4327  a1);
4328 }
4329 
4330 
4348 template <typename Class, typename ReturnType, typename A0, typename A1, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4350  Class* object,
4351  ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2, Arg3),
4352  A0 a0,
4353  A1 a1) {
4354  return new MethodCallback2_4<Class,
4356  ReturnType,
4357  A0,
4358  A1,
4359  Arg0,
4360  Arg1,
4361  Arg2,
4362  Arg3>(
4363  object,
4364  method,
4365  a0,
4366  a1);
4367 }
4368 
4369 
4373 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4374 class FunctionCallback3_4: public Parent {
4375  public:
4376  typedef ReturnType (*Function)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3);
4377  FunctionCallback3_4(Function callback, A0 a0, A1 a1, A2 a2):
4378  Parent(),
4379  m_callback(callback),
4380  m_a0(a0),
4381  m_a1(a1),
4382  m_a2(a2) {}
4383  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4384  return m_callback(m_a0, m_a1, m_a2, arg0, arg1, arg2, arg3);
4385  }
4386  private:
4387  Function m_callback;
4388  A0 m_a0;
4389  A1 m_a1;
4390  A2 m_a2;
4391 };
4392 
4393 
4411 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4413  ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3),
4414  A0 a0,
4415  A1 a1,
4416  A2 a2) {
4417  return new FunctionCallback3_4<
4418  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4419  ReturnType,
4420  A0,
4421  A1,
4422  A2,
4423  Arg0,
4424  Arg1,
4425  Arg2,
4426  Arg3>(
4427  callback,
4428  a0,
4429  a1,
4430  a2);
4431 }
4432 
4433 
4451 template <typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4453  ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3),
4454  A0 a0,
4455  A1 a1,
4456  A2 a2) {
4457  return new FunctionCallback3_4<
4459  ReturnType,
4460  A0,
4461  A1,
4462  A2,
4463  Arg0,
4464  Arg1,
4465  Arg2,
4466  Arg3>(
4467  callback,
4468  a0,
4469  a1,
4470  a2);
4471 }
4472 
4473 
4477 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4478 class MethodCallback3_4: public Parent {
4479  public:
4480  typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3);
4481  MethodCallback3_4(Class *object, Method callback, A0 a0, A1 a1, A2 a2):
4482  Parent(),
4483  m_object(object),
4484  m_callback(callback),
4485  m_a0(a0),
4486  m_a1(a1),
4487  m_a2(a2) {}
4488  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4489  return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0, arg1, arg2, arg3);
4490  }
4491  private:
4492  Class *m_object;
4493  Method m_callback;
4494  A0 m_a0;
4495  A1 m_a1;
4496  A2 m_a2;
4497 };
4498 
4499 
4519 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4521  Class* object,
4522  ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3),
4523  A0 a0,
4524  A1 a1,
4525  A2 a2) {
4526  return new MethodCallback3_4<Class,
4527  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4528  ReturnType,
4529  A0,
4530  A1,
4531  A2,
4532  Arg0,
4533  Arg1,
4534  Arg2,
4535  Arg3>(
4536  object,
4537  method,
4538  a0,
4539  a1,
4540  a2);
4541 }
4542 
4543 
4563 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4565  Class* object,
4566  ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3),
4567  A0 a0,
4568  A1 a1,
4569  A2 a2) {
4570  return new MethodCallback3_4<Class,
4572  ReturnType,
4573  A0,
4574  A1,
4575  A2,
4576  Arg0,
4577  Arg1,
4578  Arg2,
4579  Arg3>(
4580  object,
4581  method,
4582  a0,
4583  a1,
4584  a2);
4585 }
4586 
4587 
4591 template <typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4592 class FunctionCallback4_4: public Parent {
4593  public:
4594  typedef ReturnType (*Function)(A0, A1, A2, A3, Arg0, Arg1, Arg2, Arg3);
4595  FunctionCallback4_4(Function callback, A0 a0, A1 a1, A2 a2, A3 a3):
4596  Parent(),
4597  m_callback(callback),
4598  m_a0(a0),
4599  m_a1(a1),
4600  m_a2(a2),
4601  m_a3(a3) {}
4602  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4603  return m_callback(m_a0, m_a1, m_a2, m_a3, arg0, arg1, arg2, arg3);
4604  }
4605  private:
4606  Function m_callback;
4607  A0 m_a0;
4608  A1 m_a1;
4609  A2 m_a2;
4610  A3 m_a3;
4611 };
4612 
4613 
4633 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4635  ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1, Arg2, Arg3),
4636  A0 a0,
4637  A1 a1,
4638  A2 a2,
4639  A3 a3) {
4640  return new FunctionCallback4_4<
4641  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4642  ReturnType,
4643  A0,
4644  A1,
4645  A2,
4646  A3,
4647  Arg0,
4648  Arg1,
4649  Arg2,
4650  Arg3>(
4651  callback,
4652  a0,
4653  a1,
4654  a2,
4655  a3);
4656 }
4657 
4658 
4678 template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4680  ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1, Arg2, Arg3),
4681  A0 a0,
4682  A1 a1,
4683  A2 a2,
4684  A3 a3) {
4685  return new FunctionCallback4_4<
4687  ReturnType,
4688  A0,
4689  A1,
4690  A2,
4691  A3,
4692  Arg0,
4693  Arg1,
4694  Arg2,
4695  Arg3>(
4696  callback,
4697  a0,
4698  a1,
4699  a2,
4700  a3);
4701 }
4702 
4703 
4707 template <typename Class, typename Parent, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4708 class MethodCallback4_4: public Parent {
4709  public:
4710  typedef ReturnType (Class::*Method)(A0, A1, A2, A3, Arg0, Arg1, Arg2, Arg3);
4711  MethodCallback4_4(Class *object, Method callback, A0 a0, A1 a1, A2 a2, A3 a3): // NOLINT(whitespace/line_length)
4712  Parent(),
4713  m_object(object),
4714  m_callback(callback),
4715  m_a0(a0),
4716  m_a1(a1),
4717  m_a2(a2),
4718  m_a3(a3) {}
4719  ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) {
4720  return (m_object->*m_callback)(m_a0, m_a1, m_a2, m_a3, arg0, arg1, arg2, arg3); // NOLINT(whitespace/line_length)
4721  }
4722  private:
4723  Class *m_object;
4724  Method m_callback;
4725  A0 m_a0;
4726  A1 m_a1;
4727  A2 m_a2;
4728  A3 m_a3;
4729 };
4730 
4731 
4753 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4755  Class* object,
4756  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1, Arg2, Arg3),
4757  A0 a0,
4758  A1 a1,
4759  A2 a2,
4760  A3 a3) {
4761  return new MethodCallback4_4<Class,
4762  SingleUseCallback4<ReturnType, Arg0, Arg1, Arg2, Arg3>, // NOLINT(whitespace/line_length)
4763  ReturnType,
4764  A0,
4765  A1,
4766  A2,
4767  A3,
4768  Arg0,
4769  Arg1,
4770  Arg2,
4771  Arg3>(
4772  object,
4773  method,
4774  a0,
4775  a1,
4776  a2,
4777  a3);
4778 }
4779 
4780 
4802 template <typename Class, typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename Arg0, typename Arg1, typename Arg2, typename Arg3> // NOLINT(whitespace/line_length)
4804  Class* object,
4805  ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1, Arg2, Arg3),
4806  A0 a0,
4807  A1 a1,
4808  A2 a2,
4809  A3 a3) {
4810  return new MethodCallback4_4<Class,
4812  ReturnType,
4813  A0,
4814  A1,
4815  A2,
4816  A3,
4817  Arg0,
4818  Arg1,
4819  Arg2,
4820  Arg3>(
4821  object,
4822  method,
4823  a0,
4824  a1,
4825  a2,
4826  a3);
4827 }
4828 
4829 
4833 } // namespace ola
4834 #endif // INCLUDE_OLA_CALLBACK_H_