MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
mlArgumentList.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2009, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_ARGUMENT_LIST_H
14#define ML_ARGUMENT_LIST_H
15
18
19#include "mlUtilsSystem.h"
20
22
25{
26};
27
29template <class Arg1> struct ArgumentList1
30{
32 : _arg1(arg1)
33 {}
35};
36
38template <class Arg1, class Arg2> struct ArgumentList2
39{
41 : _arg1(arg1)
42 , _arg2(arg2)
43 {}
46};
47
49template <class Arg1, class Arg2, class Arg3> struct ArgumentList3
50{
51 ArgumentList3(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3)
52 : _arg1(arg1)
53 , _arg2(arg2)
54 , _arg3(arg3)
55 {}
59};
60
62template <class Arg1, class Arg2, class Arg3, class Arg4> struct ArgumentList4
63{
64 ArgumentList4(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
65 : _arg1(arg1)
66 , _arg2(arg2)
67 , _arg3(arg3)
68 , _arg4(arg4)
69 {}
74};
75
77template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5> struct ArgumentList5
78{
79 ArgumentList5(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
80 : _arg1(arg1)
81 , _arg2(arg2)
82 , _arg3(arg3)
83 , _arg4(arg4)
84 , _arg5(arg5)
85 {}
91};
92
93//----------------------------------------------------------------
96{
97 return ArgumentList0();
98};
100template <class Arg1> inline ArgumentList1<Arg1> MLGenerateArgumentList(const Arg1& arg1)
101{
103}
104
106template <class Arg1, class Arg2>
112template <class Arg1, class Arg2, class Arg3>
117
119template <class Arg1, class Arg2, class Arg3, class Arg4>
126template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5> inline ArgumentList5<Arg1, Arg2, Arg3, Arg4, Arg5>
131
132//----------------------------------------------------------------
134template <class Object, class Method>
136{
137 (object->*method)();
138}
140template <class Object, class Method, class Arg1>
142{
143 (object->*method)(args._arg1);
144}
146template <class Object, class Method, class Arg1, class Arg2>
148{
149 (object->*method)(args._arg1, args._arg2);
150}
151
153template <class Object, class Method, class Arg1, class Arg2, class Arg3>
155{
156 (object->*method)(args._arg1, args._arg2, args._arg3);
157}
159template <class Object, class Method, class Arg1, class Arg2, class Arg3, class Arg4>
161{
162 (object->*method)(args._arg1, args._arg2, args._arg3, args._arg4);
163}
165template <class Object, class Method, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
167{
168 (object->*method)(args._arg1, args._arg2, args._arg3, args._arg4, args._arg5);
169}
170
172
173#endif // __mlArgumentList_H
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
ArgumentList0 MLGenerateArgumentList()
Creates argument list with zero arguments.
void MLCallMethodWithArguments(Object *object, Method method, const ArgumentList0 &)
Calls a method on given object with zero arguments.
Empty argument to allow running with zero arguments.
ArgumentList with one argument.
ArgumentList1(const Arg1 &arg1)
ArgumentList with two arguments.
ArgumentList2(const Arg1 &arg1, const Arg2 &arg2)
ArgumentList with three arguments.
ArgumentList3(const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
ArgumentList with four arguments.
ArgumentList4(const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
ArgumentList with five arguments.
ArgumentList5(const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)