Classes | Macros | Typedefs | Functions
internals.h File Reference
#include "../pytypes.h"
Include dependency graph for internals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  internals
 
struct  override_hash
 
struct  type_equal_to
 
struct  type_hash
 
struct  type_info
 

Macros

#define PYBIND11_BUILD_ABI   ""
 On Linux/OSX, changes in GXX_ABI_VERSION indicate ABI incompatibility. More...
 
#define PYBIND11_BUILD_TYPE   ""
 On MSVC, debug and release builds are not ABI-compatible! More...
 
#define PYBIND11_COMPILER_TYPE   "_unknown"
 Let's assume that different compilers are ABI-incompatible. More...
 
#define PYBIND11_INTERNALS_ID
 
#define PYBIND11_INTERNALS_KIND   "_without_thread"
 
#define PYBIND11_INTERNALS_VERSION   4
 Tracks the internals and type_info ABI version independent of the main library version. More...
 
#define PYBIND11_MODULE_LOCAL_ID
 
#define PYBIND11_STDLIB   ""
 
#define PYBIND11_TLS_DELETE_VALUE(key)   PyThread_delete_key_value(key)
 
#define PYBIND11_TLS_FREE(key)   (void)key
 
#define PYBIND11_TLS_GET_VALUE(key)   PyThread_get_key_value((key))
 
#define PYBIND11_TLS_KEY_INIT(var)   decltype(PyThread_create_key()) var = 0
 
#define PYBIND11_TLS_REPLACE_VALUE(key, value)
 

Typedefs

template<typename value_type >
using type_map = std::unordered_map< std::type_index, value_type, type_hash, type_equal_to >
 

Functions

template<typename... Args>
const char * c_str (Args &&...args)
 
PYBIND11_NOINLINE internalsget_internals ()
 Return a reference to the current internals data. More...
 
internals **& get_internals_pp ()
 
template<typename T >
Tget_or_create_shared_data (const std::string &name)
 
PYBIND11_NOINLINE void * get_shared_data (const std::string &name)
 
PyTypeObject * make_default_metaclass ()
 
PyObject * make_object_base_type (PyTypeObject *metaclass)
 
PyTypeObject * make_static_property_type ()
 
type_map< type_info * > & registered_local_types_cpp ()
 Works like internals.registered_types_cpp, but for module-local registered types: More...
 
bool same_type (const std::type_info &lhs, const std::type_info &rhs)
 
PYBIND11_NOINLINE void * set_shared_data (const std::string &name, void *data)
 Set the shared data that can be later recovered by get_shared_data(). More...
 
void translate_exception (std::exception_ptr p)
 
void translate_local_exception (std::exception_ptr p)
 

Macro Definition Documentation

#define PYBIND11_BUILD_ABI   ""

On Linux/OSX, changes in GXX_ABI_VERSION indicate ABI incompatibility.

Definition at line 193 of file internals.h.

#define PYBIND11_BUILD_TYPE   ""

On MSVC, debug and release builds are not ABI-compatible!

Definition at line 159 of file internals.h.

#define PYBIND11_COMPILER_TYPE   "_unknown"

Let's assume that different compilers are ABI-incompatible.

Definition at line 178 of file internals.h.

#define PYBIND11_INTERNALS_ID
Value:
"__pybind11_internals_v" \
#define PYBIND11_BUILD_ABI
On Linux/OSX, changes in GXX_ABI_VERSION indicate ABI incompatibility.
Definition: internals.h:193
#define PYBIND11_INTERNALS_KIND
Definition: internals.h:199
#define PYBIND11_STDLIB
Definition: internals.h:186
#define PYBIND11_INTERNALS_VERSION
Tracks the internals and type_info ABI version independent of the main library version.
Definition: internals.h:153
#define PYBIND11_COMPILER_TYPE
Let&#39;s assume that different compilers are ABI-incompatible.
Definition: internals.h:178
#define PYBIND11_BUILD_TYPE
On MSVC, debug and release builds are not ABI-compatible!
Definition: internals.h:159

Definition at line 202 of file internals.h.

#define PYBIND11_INTERNALS_KIND   "_without_thread"

Definition at line 199 of file internals.h.

#define PYBIND11_INTERNALS_VERSION   4

Tracks the internals and type_info ABI version independent of the main library version.

Definition at line 153 of file internals.h.

#define PYBIND11_MODULE_LOCAL_ID
Value:
"__pybind11_module_local_v" \
#define PYBIND11_BUILD_ABI
On Linux/OSX, changes in GXX_ABI_VERSION indicate ABI incompatibility.
Definition: internals.h:193
#define PYBIND11_INTERNALS_KIND
Definition: internals.h:199
#define PYBIND11_STDLIB
Definition: internals.h:186
#define PYBIND11_INTERNALS_VERSION
Tracks the internals and type_info ABI version independent of the main library version.
Definition: internals.h:153
#define PYBIND11_COMPILER_TYPE
Let&#39;s assume that different compilers are ABI-incompatible.
Definition: internals.h:178
#define PYBIND11_BUILD_TYPE
On MSVC, debug and release builds are not ABI-compatible!
Definition: internals.h:159

Definition at line 205 of file internals.h.

#define PYBIND11_STDLIB   ""

Definition at line 186 of file internals.h.

#define PYBIND11_TLS_DELETE_VALUE (   key)    PyThread_delete_key_value(key)

Definition at line 34 of file internals.h.

#define PYBIND11_TLS_FREE (   key)    (void)key

Definition at line 47 of file internals.h.

#define PYBIND11_TLS_GET_VALUE (   key)    PyThread_get_key_value((key))

Definition at line 32 of file internals.h.

#define PYBIND11_TLS_KEY_INIT (   var)    decltype(PyThread_create_key()) var = 0

Definition at line 31 of file internals.h.

#define PYBIND11_TLS_REPLACE_VALUE (   key,
  value 
)
Value:
do { \
PyThread_delete_key_value((key)); \
PyThread_set_key_value((key), (value)); \
} while (false)

Definition at line 36 of file internals.h.

Typedef Documentation

template<typename value_type >
using type_map = std::unordered_map<std::type_index, value_type, type_hash, type_equal_to>

Definition at line 83 of file internals.h.

Function Documentation

template<typename... Args>
const char* c_str ( Args &&...  args)

Constructs a std::string with the given arguments, stores it in internals, and returns its c_str(). Such strings objects have a long storage duration – the internal strings are only cleared when the program exits or after interpreter shutdown (when embedding), and so are suitable for c-style strings needed by Python internals (such as PyTypeObject's tp_name).

Definition at line 314 of file internals.h.

PYBIND11_NOINLINE internals& get_internals ( )
inline

Return a reference to the current internals data.

Definition at line 245 of file internals.h.

internals**& get_internals_pp ( )
inline

Each module locally stores a pointer to the internals data. The data itself is shared among modules with the same PYBIND11_INTERNALS_ID.

Definition at line 210 of file internals.h.

template<typename T >
T& get_or_create_shared_data ( const std::string &  name)

Returns a typed reference to a shared data entry (by using get_shared_data()) if such entry exists. Otherwise, a new object of default-constructible type T is added to the shared data under the given name and a reference to it is returned.

Definition at line 341 of file internals.h.

PYBIND11_NOINLINE void* get_shared_data ( const std::string &  name)
inline

Returns a named pointer that is shared among all extension modules (using the same pybind11 version) running in the current interpreter. Names starting with underscores are reserved for internal usage. Returns nullptr if no matching entry was found.

Definition at line 325 of file internals.h.

PyTypeObject* make_default_metaclass ( )
inline

This metaclass is assigned by default to all pybind11 types and is required in order for static properties to function correctly. Users may override this using py::metaclass. Return value: New reference.

Definition at line 187 of file class.h.

PyObject* make_object_base_type ( PyTypeObject *  metaclass)
inline

Create the type which can be used as a common base for all classes. This is needed in order to satisfy Python's requirements for multiple inheritance. Return value: New reference.

Definition at line 398 of file class.h.

PyTypeObject* make_static_property_type ( )
inline

A static_property is the same as a property but the __get__() and __set__() methods are modified to always use the object type instead of a concrete instance. Return value: New reference.

Definition at line 48 of file class.h.

type_map<type_info *>& registered_local_types_cpp ( )
inline

Works like internals.registered_types_cpp, but for module-local registered types:

Definition at line 304 of file internals.h.

bool same_type ( const std::type_info &  lhs,
const std::type_info &  rhs 
)
inline

Definition at line 61 of file internals.h.

PYBIND11_NOINLINE void* set_shared_data ( const std::string &  name,
void *  data 
)
inline

Set the shared data that can be later recovered by get_shared_data().

Definition at line 332 of file internals.h.

void translate_exception ( std::exception_ptr  p)
inline

Definition at line 215 of file internals.h.

void translate_local_exception ( std::exception_ptr  p)
inline

Definition at line 235 of file internals.h.



gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:30