Binds C++ enumerations and enumeration classes to Python. More...
#include <pybind11.h>
Public Types | |
using | Base = class_< Type > |
using | Scalar = detail::conditional_t< detail::any_of< detail::is_std_char_type< Underlying >, std::is_same< Underlying, bool > >::value, detail::equivalent_integer_t< Underlying >, Underlying > |
using | Underlying = typename std::underlying_type< Type >::type |
Public Types inherited from class_< Type > | |
using | holder_type = detail::exactly_one_t< is_holder, std::unique_ptr< type >, options... > |
using | type = Type |
using | type_alias = detail::exactly_one_t< is_subtype, void, options... > |
Public Member Functions | |
template<typename... Extra> | |
enum_ (const handle &scope, const char *name, const Extra &...extra) | |
enum_ & | export_values () |
Export enumeration entries into the parent scope. More... | |
enum_ & | value (char const *name, Type value, const char *doc=nullptr) |
Add an enumeration entry. More... | |
Public Member Functions inherited from class_< Type > | |
class_ (handle scope, const char *name, const Extra &...extra) | |
class_ & | def (const char *name_, Func &&f, const Extra &...extra) |
class_ & | def (const detail::initimpl::alias_constructor< Args... > &init, const Extra &...extra) |
class_ & | def (const detail::initimpl::constructor< Args... > &init, const Extra &...extra) |
class_ & | def (const T &op, const Extra &...extra) |
class_ & | def (detail::initimpl::factory< Args... > &&init, const Extra &...extra) |
class_ & | def (detail::initimpl::pickle_factory< Args... > &&pf, const Extra &...extra) |
class_ & | def_buffer (Func &&func) |
class_ & | def_buffer (Return(Class::*func)(Args...) const) |
class_ & | def_buffer (Return(Class::*func)(Args...)) |
class_ & | def_cast (const T &op, const Extra &...extra) |
class_ & | def_property (const char *name, const cpp_function &fget, const cpp_function &fset, const Extra &...extra) |
Uses cpp_function's return_value_policy by default. More... | |
class_ & | def_property (const char *name, const Getter &fget, const cpp_function &fset, const Extra &...extra) |
class_ & | def_property (const char *name, const Getter &fget, const Setter &fset, const Extra &...extra) |
Uses return_value_policy::reference_internal by default. More... | |
class_ & | def_property_readonly (const char *name, const cpp_function &fget, const Extra &...extra) |
Uses cpp_function's return_value_policy by default. More... | |
class_ & | def_property_readonly (const char *name, const Getter &fget, const Extra &...extra) |
Uses return_value_policy::reference_internal by default. More... | |
class_ & | def_property_readonly_static (const char *name, const cpp_function &fget, const Extra &...extra) |
Uses cpp_function's return_value_policy by default. More... | |
class_ & | def_property_readonly_static (const char *name, const Getter &fget, const Extra &...extra) |
Uses return_value_policy::reference by default. More... | |
class_ & | def_property_static (const char *name, const cpp_function &fget, const cpp_function &fset, const Extra &...extra) |
Uses cpp_function's return_value_policy by default. More... | |
class_ & | def_property_static (const char *name, const Getter &fget, const cpp_function &fset, const Extra &...extra) |
Uses return_value_policy::reference by default. More... | |
class_ & | def_readonly (const char *name, const D C::*pm, const Extra &...extra) |
class_ & | def_readonly_static (const char *name, const D *pm, const Extra &...extra) |
class_ & | def_readwrite (const char *name, D C::*pm, const Extra &...extra) |
class_ & | def_readwrite_static (const char *name, D *pm, const Extra &...extra) |
class_ & | def_static (const char *name_, Func &&f, const Extra &...extra) |
Private Attributes | |
detail::enum_base | m_base |
Additional Inherited Members | |
Static Public Member Functions inherited from class_< Type > | |
static void | add_base (detail::type_record &) |
static void | add_base (detail::type_record &rec) |
Static Public Attributes inherited from class_< Type > | |
constexpr static bool | has_alias |
Binds C++ enumerations and enumeration classes to Python.
Definition at line 2264 of file pybind11.h.
Definition at line 2266 of file pybind11.h.
using enum_< Type >::Scalar = detail::conditional_t<detail::any_of<detail::is_std_char_type<Underlying>, std::is_same<Underlying, bool> >::value, detail::equivalent_integer_t<Underlying>, Underlying> |
Definition at line 2276 of file pybind11.h.
using enum_< Type >::Underlying = typename std::underlying_type<Type>::type |
Definition at line 2271 of file pybind11.h.
|
inline |
Definition at line 2279 of file pybind11.h.
Export enumeration entries into the parent scope.
Definition at line 2301 of file pybind11.h.
|
inline |
Add an enumeration entry.
Definition at line 2307 of file pybind11.h.
Definition at line 2313 of file pybind11.h.