version 0.4.1
pythonhelpers.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2025 The Ikarus Developers mueller@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#pragma once
5
6#define ENUM_BINDINGS_WITH_MODULE(Type, module) \
7 py::enum_<Type> Type##Enum(module, #Type); \
8 Type Type##EnumV = Type::BEGIN; \
9 Ikarus::increment(Type##EnumV); \
10 for (; Type##EnumV != Type::END; Ikarus::increment(Type##EnumV)) \
11 Type##Enum.value(toString(Type##EnumV).c_str(), Type##EnumV);
12
13#define ENUM_BINDINGS(Type) ENUM_BINDINGS_WITH_MODULE(Type, m)