Scarab  v2.11.1
Project 8 C++ Utility Library
Public Member Functions | Public Attributes | List of all members
enum_base Struct Reference

#include <pybind11.h>

Public Member Functions

 enum_base (handle base, handle parent)
 
 __attribute__ ((noinline)) void init(bool is_arithmetic
 
m_base attr ("__repr__")
 
m_base attr ("name")
 
m_base attr ("__doc__")
 
m_base attr ("__members__")
 
 if (is_convertible)
 
m_base attr ("__ne__")
 
 if (is_arithmetic)
 
m_base attr ("__getstate__")
 
m_base attr ("__hash__")
 
 __attribute__ ((noinline)) void value(char const *name_
 

Public Attributes

bool is_convertible
 
auto property = handle((PyObject *) &PyProperty_Type)
 
auto static_property = handle((PyObject *) get_internals().static_property_type)
 
 else
 
object getstate
 
object value
 
object const char * doc
 
handle m_parent
 

Detailed Description

Definition at line 1395 of file pybind11.h.

Constructor & Destructor Documentation

◆ enum_base()

enum_base ( handle  base,
handle  parent 
)
inline

Definition at line 1396 of file pybind11.h.

Member Function Documentation

◆ __attribute__() [1/2]

__attribute__ ( (noinline)  )

◆ __attribute__() [2/2]

__attribute__ ( (noinline)  ) const

◆ attr() [1/7]

m_base attr ( "__repr__"  )

◆ attr() [2/7]

m_base attr ( "name"  )

◆ attr() [3/7]

m_base attr ( "__doc__"  )

◆ attr() [4/7]

m_base attr ( "__members__"  )

◆ attr() [5/7]

m_base attr ( "__ne__"  )

◆ attr() [6/7]

m_base attr ( "__getstate__"  )

◆ attr() [7/7]

m_base attr ( "__hash__"  )

◆ if() [1/2]

if ( is_convertible  )
inline

Definition at line 1472 of file pybind11.h.

◆ if() [2/2]

if ( is_arithmetic  )
inline

Definition at line 1492 of file pybind11.h.

Member Data Documentation

◆ doc

object const char* doc
Initial value:
= nullptr) {
dict entries = m_base.attr("__entries");
str name(name_);
if (entries.contains(name)) {
std::string type_name = (std::string) str(m_base.attr("__name__"));
throw value_error(type_name + ": element \"" + std::string(name_) + "\" already exists!");
}
entries[name] = std::make_pair(value, doc);
m_base.attr(name) = value;
}
__attribute__ ((noinline)) void export_values() {
dict entries = m_base.attr("__entries");
for (const auto &kv : entries)
m_parent.attr(kv.first) = kv.second[int_(0)];
}
handle m_base

Definition at line 1512 of file pybind11.h.

◆ else

else
Initial value:
{
m_base.attr( "__eq__" ) = cpp_function( [](object a, object b) { if (!a.get_type().is(b.get_type())) return false ; return int_(a).equal(int_(b)) ; }, is_method(m_base))

Definition at line 1488 of file pybind11.h.

◆ getstate

object getstate
Initial value:
= cpp_function(
[](object arg) { return int_(arg); }, is_method(m_base))

Definition at line 1505 of file pybind11.h.

◆ is_convertible

bool is_convertible
Initial value:
{
m_base.attr("__entries") = dict()

Definition at line 1398 of file pybind11.h.

◆ m_parent

handle m_parent

Definition at line 1531 of file pybind11.h.

◆ property

auto property = handle((PyObject *) &PyProperty_Type)

Definition at line 1400 of file pybind11.h.

◆ static_property

auto static_property = handle((PyObject *) get_internals().static_property_type)

Definition at line 1401 of file pybind11.h.

◆ value

object value

Definition at line 1512 of file pybind11.h.


The documentation for this struct was generated from the following file: