-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmethods.h
59 lines (39 loc) · 1.2 KB
/
methods.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// SPDX-FileCopyrightText: 2024 Johann Klähn <[email protected]>
//
// SPDX-License-Identifier: MIT
#pragma once
#include <genpybind/genpybind.h>
struct Example;
struct GENPYBIND(visible) Other {
GENPYBIND(expose_as(toExample))
operator Example() const;
};
void consumes_other(Other) GENPYBIND(visible);
/// A brief docstring.
struct GENPYBIND(visible) Example {
/// Another brief docstring.
int public_method();
int public_const_method() const;
int old_name() const GENPYBIND(expose_as(new_name));
int overloaded(int value) const;
double overloaded(double value) const;
void deleted_method() = delete;
void hidden_method() GENPYBIND(hidden);
static Example static_method();
GENPYBIND(expose_as(__int__))
operator int() const;
operator bool() const;
operator Other() const;
int operator()() const { return 123; }
int operator()(int value) const { return value; }
GENPYBIND(expose_as(call))
float operator()(float value) const { return value; }
private:
void private_method();
};
struct GENPYBIND(visible) ExoticMemberFunctions {
typedef int FunctionType();
FunctionType function;
typedef int OtherFunctionType() const;
OtherFunctionType other_function;
};