1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the test suite of Qt for Python.
7 **
8 ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21 ** included in the packaging of this file. Please review the following
22 ** information to ensure the GNU General Public License requirements will
23 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24 **
25 ** $QT_END_LICENSE$
26 **
27 ****************************************************************************/
28 
29 #ifndef OVERLOADSORT_H
30 #define OVERLOADSORT_H
31 
32 #include "libsamplemacros.h"
33 
34 #include <list>
35 
36 class ImplicitTarget
37 {
38 public:
ImplicitTarget()39     ImplicitTarget(){}
40 };
41 
42 class ImplicitBase
43 {
44 public:
ImplicitBase()45     ImplicitBase(){}
ImplicitBase(const ImplicitTarget & b)46     ImplicitBase(const ImplicitTarget &b){}
47 };
48 
49 class SortedOverload
50 {
51 public:
52 
overload(int x)53     inline const char *overload(int x) {
54         return "int";
55     }
56 
overload(double x)57     inline const char *overload(double x) {
58         return "double";
59     }
60 
overload(ImplicitBase x)61     inline const char *overload(ImplicitBase x) {
62         return "ImplicitBase";
63     }
64 
overload(ImplicitTarget x)65     inline const char *overload(ImplicitTarget x) {
66         return "ImplicitTarget";
67     }
68 
overload(const std::list<ImplicitBase> & x)69     inline const char *overload(const std::list<ImplicitBase> &x) {
70         return "list(ImplicitBase)";
71     }
72 
implicit_overload(const ImplicitBase & x)73     inline int implicit_overload(const ImplicitBase &x) {
74         return 1;
75     }
76 
overloadDeep(int x,ImplicitBase & y)77     inline const char *overloadDeep(int x, ImplicitBase &y) {
78         return "ImplicitBase";
79     }
80 
81 
pyObjOverload(int,int)82     inline const char* pyObjOverload(int, int) { return "int,int"; }
pyObjOverload(unsigned char *,int)83     inline const char* pyObjOverload(unsigned char*, int) { return "PyObject,int"; }
84 
85 };
86 
87 class LIBSAMPLE_API CustomOverloadSequence
88 {
89 public:
90     int overload(short v) const;
91     int overload(int v) const;
92 };
93 
94 #endif // OVERLOADSORT_H
95 
96