CPythonLibraryInterface Class Reference

#include <cpython.h>

Inheritance diagram for CPythonLibraryInterface:

Public Types

using  TYPE_CONVERSION_TUPLE = Tuple < DataType , DelegatePyObject_AsData , DelegatePyObject_FromData <> >

公共成员函数

MAXON_METHOD Result < void >  Init (const Url &librarypath, Bool createSubLibrary)
MAXON_METHOD Result < void >  InitTypes ()
MAXON_METHOD Result < void >  InitBuiltinModules ()
MAXON_METHOD void  CPy_Initialize ()
MAXON_METHOD void  CPy_Finalize ()
MAXON_METHOD CPyRef   CPyModule_Create (const ModuleDefinition &module)
MAXON_METHOD void  Free (const Delegate < void()> &shutdownEngine)
const MAXON_METHOD PythonDll GetDll () const
MAXON_METHOD FILE_native FopenNative (const Char *name, const Char *mode)
MAXON_METHOD Error  LastPythonCallFailed ( MAXON_SOURCE_LOCATION_DECLARATION , Bool withTraceback, Bool restoreError)
MAXON_METHOD Result < MPyDataRef RegisterComponentProxy (const CPyRef &type, const Id ®istryId, const ProxyDefinition &baseAndInterfaceIds, const Id &cid, Bool printErrors, ClassInterface::KIND kind, const SourceLocation &loc, Bool createObject, const DataType &dtOfObject)
MAXON_METHOD Bool   CPy_IsInitialized ()
const MAXON_METHOD Char CPy_GetVersion ()
const MAXON_METHOD Char CPy_GetPlatform ()
const MAXON_METHOD Char CPy_GetCopyright ()
const MAXON_METHOD Char CPy_GetCompiler ()
const MAXON_METHOD Char CPy_GetBuildInfo ()
MAXON_METHOD Result < void >  CPy_SetProgramName (const String &name)
MAXON_METHOD Result < void >  CPy_SetPythonHome (const Url &name)
MAXON_METHOD String   CPy_GetProgramName ()
MAXON_METHOD String   CPy_GetPythonHome ()
MAXON_METHOD Bool   ExecuteModule (const String &name)
MAXON_METHOD MPyCallerContextRef   CPyCallerContext_New ()
MAXON_METHOD Bool   CPyRun_SimpleFileExFlags ( FILE_native *fp, const Char *filename, Int32 closeit, CPyCompilerFlags *flags)
MAXON_METHOD Bool   CPyRun_SimpleFileExFlags (const Url &url, CPyCompilerFlags *flags)
MAXON_METHOD CPyRef   CPyRun_SimpleStringFlags (const String &code, CPyCompilerFlags *flags)
MAXON_METHOD NativePyObject CPyRun_FileExFlags ( FILE_native *fp, const Char *filename, Int32 start, NativePyObject *globals, NativePyObject *locals, Int32 closeit, CPyCompilerFlags *flags)
MAXON_METHOD Result < void >  CPyRun_InteractiveLoopFlags (FILE *fp, const Char *filename, CPyCompilerFlags *flags)
MAXON_METHOD PYGILSTATE   CPyGilState_Ensure ()
MAXON_METHOD void  CPyGilState_Release ( PYGILSTATE state)
MAXON_METHOD GILSTATE   GetGilState () const
MAXON_METHOD NativePyThreadState CPyGILState_GetThisThreadState ()
MAXON_METHOD NativePyThreadState CPyThreadState_Swap ( NativePyThreadState *state)
MAXON_METHOD CPyRef   CPyThreadState_GetDict ()
MAXON_METHOD CPyCodeRef   CPy_CompileStringFlags (const Char *code, const Char *filename, PYINPUT start, CPyCompilerFlags *flags=nullptr)
MAXON_METHOD void  CPy_Incref ( NativePyObject *o) const
MAXON_METHOD void  CPy_Decref ( NativePyObject *o) const
MAXON_METHOD void  CPy_SafeIncref ( NativePyObject *o) const
MAXON_METHOD void  CPy_SafeDecref ( NativePyObject *o) const
template<typename T >
MAXON_FUNCTION void  CPy_SafeClear (T *&o) const
MAXON_METHOD Int64   CPyGC_Collect ()
MAXON_METHOD Int32   CPyCode_Addr2Line (const CPyCodeRef &codeObject, Int32 x)
MAXON_METHOD CPyRef   UnpackDataType (const CPyRef &obj)
MAXON_METHOD CPyRef   UnpackData (const CPyRef &obj)
MAXON_METHOD CPyConstRef   CPy_None () const
MAXON_METHOD CPyConstRef   CPy_True () const
MAXON_METHOD CPyConstRef   CPy_False () const
MAXON_METHOD CPyConstRef   CPy_NotImplemented () const
MAXON_METHOD void  CPyErr_Print ()
MAXON_METHOD void  CPyErr_Clear ()
MAXON_METHOD Bool   CPyErr_Occurred ( CPyRef *type=nullptr)
MAXON_METHOD CPyRef   CPyErr_SetString (const CPyRef &errorType, const Char *errorString=nullptr)
MAXON_METHOD CPyRef   CPyErr_SetWithErrnoAndFilename (const CPyRef &errorType, Int32 errorNumber, const Char *filename)
MAXON_METHOD CPyRef   CPyErr_SetWithErrno (const CPyRef &errorType, Int32 errorNumber)
MAXON_METHOD CPyRef   CPyErr_SetString (const CPyRef &errorType, const String &errorString)
MAXON_METHOD void  CPyErr_SetNone (const CPyRef &errorType)
MAXON_METHOD void  CPyErr_Fetch ( CPyRef &type, CPyRef &value, CPyRef &traceback)
MAXON_METHOD void  CPyErr_NormalizeException ( CPyRef &type, CPyRef &value, CPyRef &traceback)
MAXON_METHOD void  CPyErr_Restore (const CPyRef &type, const CPyRef &value, const CPyRef &traceback)
MAXON_METHOD Bool   CPyErr_ExceptionMatches (const CPyRef &exc)
MAXON_METHOD Bool   CPyExceptionClass_Check (const CPyRef &o)
MAXON_METHOD CPyRef   CPyCapsule_New (void *pointer, const Char *name, CPyCapsule_Destructor *destructor) const
MAXON_METHOD Bool   CPyCapsule_SetPointer (const CPyRef &capsule, void *pointer)
MAXON_METHOD void *  CPyCapsule_GetPointer (const CPyRef &capsule, const Char *name)
MAXON_METHOD void *  CPyCapsule_GetContext (const CPyRef &capsule)
MAXON_METHOD Bool   CPyCapsule_SetContext (const CPyRef &capsule, void *context)
MAXON_METHOD Bool   CPyCapsule_CheckExact (const CPyRef &o)
MAXON_METHOD Bool   CPyTraceBack_Check (const CPyRef &o)
MAXON_METHOD Bool   CPyClass_Check (const CPyRef &o)
MAXON_METHOD CPyRef   CPyTuple_New ( UInt size) const
MAXON_METHOD UInt   CPyTuple_Size (const CPyRef &tuple)
MAXON_METHOD CPyRef   CPyTuple_GetItem (const CPyRef &tuple, UInt index)
MAXON_METHOD Bool   CPyTuple_SetItem (const CPyRef &tuple, UInt index, const CPyRef &item)
MAXON_METHOD CPyRef   CPyTuple_GetSlice (const CPyRef &tuple, UInt from, UInt to)
MAXON_METHOD Bool   CPyTuple_CheckExact (const CPyRef &tuple)
MAXON_METHOD Bool   CPyObject_HasAttrString (const CPyRef &o, const Char *attrName)
MAXON_METHOD Bool   CPyObject_SetAttrString (const CPyRef &o, const Char *name, const CPyRef &item)
MAXON_METHOD CPyRef   CPyObject_GetAttrString (const CPyRef &o, const Char *name)
MAXON_METHOD CPyRef   CPyObject_Call (const CPyRef &callable_object, const CPyRef &tupleArg, const CPyRef &kw)
MAXON_METHOD CPyRef   CPyObject_Str (const CPyRef &o)
MAXON_METHOD CPyRef   CPyObject_Repr (const CPyRef &o)
MAXON_METHOD CPyRef   CPyObject_Dir (const CPyRef &o)
MAXON_METHOD CPyRef   CPyObject_RichCompare (const CPyRef &o1, const CPyRef &o2, Int32 opid)
MAXON_METHOD Int64   CPyObject_Hash (const CPyRef &o)
MAXON_METHOD Bool   CPyObject_IsTrue (const CPyRef &o)
MAXON_METHOD Bool   CPyObject_Not (const CPyRef &o)
MAXON_METHOD Bool   CPyCallable_Check (const CPyRef &o)
MAXON_METHOD Int   CPyObject_Length (const CPyRef &o)
MAXON_METHOD CPyRef   CPyObject_GetItem (const CPyRef &o, const CPyRef &key)
MAXON_METHOD CPyRef   CPyObject_GetItemInt (const CPyRef &o, Int index)
MAXON_METHOD CPyRef   CPyObject_GetItemString (const CPyRef &o, const Char *index)
MAXON_METHOD Bool   CPyObject_DelItem (const CPyRef &o, const CPyRef &key)
MAXON_METHOD Bool   CPyObject_SetItem (const CPyRef &o, const CPyRef &key, const CPyRef &item)
MAXON_METHOD Bool   CPyObject_TypeCheck (const CPyRef &object, const CPyTypeRef &type)
MAXON_METHOD CPyRef   CPyObject_CallFunction (const CPyRef &o)
MAXON_METHOD CPyRef   CPySys_GetObject (const Char *name)
MAXON_METHOD Bool   CPySys_SetObject (const Char *name, const CPyRef &o)
MAXON_METHOD Result < void >  CPy_SetPath (const BaseArray < Url > &paths)
MAXON_METHOD Result < void >  CPySys_SetPath (const BaseArray < Url > &paths, PATHHANDLE add)
MAXON_METHOD Result < void >  CPySys_SetArgvEx (const BaseArray < String > &args, Bool updatepath)
MAXON_METHOD BaseArray < Url CPySys_GetPath ()
MAXON_METHOD Result < void >  CPySite_AddSiteDir (const Url &siteDir)
MAXON_METHOD Bool   CPyUnicode_Check (const CPyRef &o)
MAXON_METHOD CPyRef   CPyUnicode_FromString (const Char *str) const
MAXON_METHOD CPyRef   CPyUnicode_FromStringAndSize (const Block < const Char > &block)
MAXON_METHOD Result < String CPyUnicode_AsString (const CPyRef &str)
const MAXON_METHOD Char CPyUnicode_AsCString (const CPyRef &str)
MAXON_METHOD Int   CPyUnicode_GetLength (const CPyRef &str)
MAXON_METHOD CPyRef   CPyObject_GetIter (const CPyRef &o) const
MAXON_METHOD CPyRef   CPyIter_Next (const CPyRef &it) const
MAXON_METHOD CPyRef   CPyDict_New () const
MAXON_METHOD CPyRef   CPyDict_GetItem (const CPyRef &dict, const CPyRef &key, Bool raiseKeyError)
MAXON_METHOD CPyRef   CPyDict_GetItemString (const CPyRef &dict, const Char *key, Bool raiseKeyError)
MAXON_METHOD Bool   CPyDict_SetItem (const CPyRef &dict, const CPyRef &key, const CPyRef &item)
MAXON_METHOD Bool   CPyDict_DelItem (const CPyRef &dict, const CPyRef &key)
MAXON_METHOD CONTAINS   CPyDict_Contains (const CPyRef &dict, const CPyRef &key)
MAXON_METHOD void  CPyDict_Clear (const CPyRef &dict)
MAXON_METHOD Bool   CPyDict_Next (const CPyRef &dict, Int &pos, CPyRef &key, CPyRef &value)
MAXON_METHOD CPyRef   CPyDict_Keys (const CPyRef &dict)
MAXON_METHOD CPyRef   CPyDict_Values (const CPyRef &dict)
MAXON_METHOD CPyRef   CPyDict_Items (const CPyRef &dict)
MAXON_METHOD Int   CPyDict_Size (const CPyRef &dict)
MAXON_METHOD CPyRef   CPyDict_Copy (const CPyRef &dict)
MAXON_METHOD Bool   CPyDict_SetItemString (const CPyRef &dict, const Char *key, const CPyRef &item) const
MAXON_METHOD Bool   CPyDict_Check (const CPyRef &o) const
MAXON_METHOD CPyRef   CPyList_New ( UInt size)
MAXON_METHOD Bool   CPyList_CheckExact (const CPyRef &list)
MAXON_METHOD Int   CPyList_Size (const CPyRef &list)
MAXON_METHOD CPyRef   CPyList_GetItem (const CPyRef &list, UInt index)
MAXON_METHOD Bool   CPyList_SetItem (const CPyRef &list, UInt , const CPyRef &item)
MAXON_METHOD Bool   CPyList_Insert (const CPyRef &list, UInt , const CPyRef &item)
MAXON_METHOD Bool   CPyList_Append (const CPyRef &list, const CPyRef &item)
MAXON_METHOD CPyRef   CPyList_GetSlice (const CPyRef &list, UInt from, UInt to)
MAXON_METHOD Bool   CPyList_SetSlice (const CPyRef &list, UInt from, UInt to, const CPyRef &item)
MAXON_METHOD Bool   CPyList_Sort (const CPyRef &list)
MAXON_METHOD Bool   CPyList_Reverse (const CPyRef &list)
MAXON_METHOD CPyRef   CPyList_AsTuple (const CPyRef &list)
MAXON_METHOD Bool   CPyDict_DelItemString (const CPyRef &p, const Char *key)
MAXON_METHOD Bool   CPyModule_Check (const CPyRef &o)
MAXON_METHOD Bool   CPyModule_AddObject (const CPyRef &module, const Char *name, const CPyRef &value)
MAXON_METHOD CPyRef   CPyModule_GetDict (const CPyRef &module)
MAXON_METHOD Bool   CPyModule_AddIntConstant (const CPyRef &mod, const Char *name, long value)
MAXON_METHOD CPyRef   CPyImport_ImportModule (const Char *name)
MAXON_METHOD CPyRef   CPyImport_GetImporter (const CPyRef &path)
MAXON_METHOD CPyRef   CPyImport_GetModuleDict ()
MAXON_METHOD Bool   CPyType_Check (const CPyRef &o)
MAXON_METHOD Bool   CPyType_IsSubtype (const CPyTypeRef &a, const CPyTypeRef &b)
MAXON_METHOD Bool   CPyType_HasFeature (const CPyTypeRef &type, Int64 f) const
MAXON_METHOD Bool   CPyType_FastSubclass (const CPyTypeRef &type, Int64 f) const
MAXON_METHOD Result < String CPyType_GetName (const CPyTypeRef &type)
MAXON_METHOD Bool   CPyType_Ready ( CPyTypeRef &type)
MAXON_METHOD NativePyThreadState CPyEval_SaveThread ()
MAXON_METHOD void  CPyEval_RestoreThread ( NativePyThreadState *state)
MAXON_METHOD Bool   CPyEval_ThreadsInitialized ()
MAXON_METHOD void  CPyEval_InitThreads ()
MAXON_METHOD void  CPyEval_AcquireThread ( NativePyThreadState *state)
MAXON_METHOD void  CPyEval_ReleaseThread ( NativePyThreadState *state)
MAXON_METHOD void  CPyEval_ReInitThreads ()
MAXON_METHOD CPyRef   CPyEval_GetBuiltins () const
MAXON_METHOD CPyRef   CPyEval_EvalCode (const CPyCodeRef &code, const CPyRef &globals, const CPyRef &locals) const
MAXON_METHOD Bool   CPyFloat_Check (const CPyRef &o)
MAXON_METHOD CPyRef   CPyFloat_FromFloat32 ( Float32 value)
MAXON_METHOD CPyRef   CPyFloat_FromFloat64 ( Float64 value)
MAXON_METHOD Float64   CPyFloat_AsFloat64 (const CPyRef &o)
template<typename T >
MAXON_FUNCTION CPyFloat_As (const CPyRef &o)
template<typename T >
MAXON_FUNCTION CPyRef   CPyFloat_From (std::enable_if_t< STD_IS_REPLACEMENT (same, T, Float32 ), Float32 > o)
template<typename T >
MAXON_FUNCTION CPyRef   CPyFloat_From (std::enable_if_t< STD_IS_REPLACEMENT (same, T, Float64 ), Float64 > o)
MAXON_METHOD Bool   CPyLong_Check (const CPyRef &o)
MAXON_METHOD CPyRef   CPyBool_FromBool ( Bool value)
MAXON_METHOD CPyRef   CPyLong_FromInt16 ( Int16 value)
MAXON_METHOD CPyRef   CPyLong_FromUInt16 ( UInt16 value)
MAXON_METHOD CPyRef   CPyLong_FromInt32 ( Int32 value)
MAXON_METHOD CPyRef   CPyLong_FromUInt32 ( UInt32 value)
MAXON_METHOD CPyRef   CPyLong_FromInt64 ( Int64 value)
MAXON_METHOD CPyRef   CPyLong_FromUInt64 ( UInt64 value)
MAXON_METHOD Int16   CPyLong_AsInt16 (const CPyRef &o)
MAXON_METHOD UInt16   CPyLong_AsUInt16 (const CPyRef &o)
MAXON_METHOD Int32   CPyLong_AsInt32 (const CPyRef &o)
MAXON_METHOD UInt32   CPyLong_AsUInt32 (const CPyRef &o)
MAXON_METHOD Int64   CPyLong_AsInt64 (const CPyRef &o)
MAXON_METHOD UInt64   CPyLong_AsUInt64 (const CPyRef &o)
template<typename T >
MAXON_FUNCTION CPyLong_As (const CPyRef &o)
template<typename T >
MAXON_FUNCTION CPyRef   CPyLong_From (std::enable_if_t< std::is_same< T, Int32 >::value, Int32 > o)
template<typename T >
MAXON_FUNCTION CPyRef   CPyLong_From (std::enable_if_t< std::is_same< T, Int64 >::value, Int64 > o)
MAXON_METHOD Bool   CPyNumber_Check (const CPyRef &o)
MAXON_METHOD MPyFunctionRef   MPyFunction_New (const reflection::Function *func)
MAXON_METHOD MPyMemberRef   MPyMember_New (const reflection::Member *member)
MAXON_METHOD Result < void >  CPyMem_SetAllocator ( CPyMemAllocatorDomain domain, CPyMemAllocatorEx *allocator)
MAXON_METHOD MPyClassRef   MPyClass_New (const reflection::Class *cls)
MAXON_METHOD Int32 CPy_DebugFlag ()
MAXON_METHOD Int32 CPy_VerboseFlag ()
MAXON_METHOD Int32 CPy_InteractiveFlag ()
MAXON_METHOD Int32 CPy_InspectFlag ()
MAXON_METHOD Int32 CPy_OptimizeFlag ()
MAXON_METHOD Int32 CPy_NoSiteFlag ()
MAXON_METHOD Int32 CPy_BytesWarningFlag ()
MAXON_METHOD Int32 CPy_FrozenFlag ()
MAXON_METHOD Int32 CPy_IgnoreEnvironmentFlag ()
MAXON_METHOD Int32 CPy_DontWriteBytecodeFlag ()
MAXON_METHOD Int32 CPy_NoUserSiteDirectory ()
MAXON_METHOD CPyConstRef   CPyExc_BaseException ()
MAXON_METHOD CPyConstRef   CPyExc_Exception ()
MAXON_METHOD CPyConstRef   CPyExc_StopIteration ()
MAXON_METHOD CPyConstRef   CPyExc_GeneratorExit ()
MAXON_METHOD CPyConstRef   CPyExc_StandardError ()
MAXON_METHOD CPyConstRef   CPyExc_ArithmeticError ()
MAXON_METHOD CPyConstRef   CPyExc_LookupError ()
MAXON_METHOD CPyConstRef   CPyExc_AssertionError ()
MAXON_METHOD CPyConstRef   CPyExc_AttributeError ()
MAXON_METHOD CPyConstRef   CPyExc_EOFError ()
MAXON_METHOD CPyConstRef   CPyExc_FloatingPointError ()
MAXON_METHOD CPyConstRef   CPyExc_EnvironmentError ()
MAXON_METHOD CPyConstRef   CPyExc_IOError ()
MAXON_METHOD CPyConstRef   CPyExc_OSError ()
MAXON_METHOD CPyConstRef   CPyExc_ImportError ()
MAXON_METHOD CPyConstRef   CPyExc_IndexError ()
MAXON_METHOD CPyConstRef   CPyExc_KeyError ()
MAXON_METHOD CPyConstRef   CPyExc_KeyboardInterrupt ()
MAXON_METHOD CPyConstRef   CPyExc_MemoryError ()
MAXON_METHOD CPyConstRef   CPyExc_NameError ()
MAXON_METHOD CPyConstRef   CPyExc_OverflowError ()
MAXON_METHOD CPyConstRef   CPyExc_RuntimeError ()
MAXON_METHOD CPyConstRef   CPyExc_NotImplementedError ()
MAXON_METHOD CPyConstRef   CPyExc_SyntaxError ()
MAXON_METHOD CPyConstRef   CPyExc_IndentationError ()
MAXON_METHOD CPyConstRef   CPyExc_TabError ()
MAXON_METHOD CPyConstRef   CPyExc_ReferenceError ()
MAXON_METHOD CPyConstRef   CPyExc_SystemError ()
MAXON_METHOD CPyConstRef   CPyExc_SystemExit ()
MAXON_METHOD CPyConstRef   CPyExc_TypeError ()
MAXON_METHOD CPyConstRef   CPyExc_UnboundLocalError ()
MAXON_METHOD CPyConstRef   CPyExc_UnicodeError ()
MAXON_METHOD CPyConstRef   CPyExc_UnicodeEncodeError ()
MAXON_METHOD CPyConstRef   CPyExc_UnicodeDecodeError ()
MAXON_METHOD CPyConstRef   CPyExc_UnicodeTranslateError ()
MAXON_METHOD CPyConstRef   CPyExc_ValueError ()
MAXON_METHOD CPyConstRef   CPyExc_ZeroDivisionError ()
MAXON_METHOD CPyConstRef   CPyExc_WindowsError ()
MAXON_METHOD CPyConstRef   CPyExc_BufferError ()
MAXON_METHOD CPyConstRef   CPyExc_MemoryErrorInst ()
MAXON_METHOD CPyConstRef   CPyExc_RecursionErrorInst ()
MAXON_METHOD CPyConstRef   CPyExc_Warning ()
MAXON_METHOD CPyConstRef   CPyExc_UserWarning ()
MAXON_METHOD CPyConstRef   CPyExc_DeprecationWarning ()
MAXON_METHOD CPyConstRef   CPyExc_PendingDeprecationWarning ()
MAXON_METHOD CPyConstRef   CPyExc_SyntaxWarning ()
MAXON_METHOD CPyConstRef   CPyExc_RuntimeWarning ()
MAXON_METHOD CPyConstRef   CPyExc_FutureWarning ()
MAXON_METHOD CPyConstRef   CPyExc_ImportWarning ()
MAXON_METHOD CPyConstRef   CPyExc_UnicodeWarning ()
MAXON_METHOD CPyConstRef   CPyExc_BytesWarning ()
MAXON_METHOD CPyTypeConstRef   CPyNullImporter_Type ()
MAXON_METHOD CPyTypeConstRef   CPySuper_Type ()
MAXON_METHOD CPyTypeConstRef   CPyBool_Type ()
MAXON_METHOD CPyTypeConstRef   CPyObject_Type ()
MAXON_METHOD CPyTypeConstRef   CPyModule_Type ()
MAXON_METHOD CPyTypeConstRef   CPyUnicode_Type ()
MAXON_METHOD CPyTypeConstRef   CPyLong_Type ()
MAXON_METHOD CPyTypeConstRef   CPyFloat_Type ()
MAXON_METHOD CPyTypeConstRef   CPyTuple_Type ()
MAXON_METHOD CPyTypeConstRef   CPyList_Type ()
MAXON_METHOD CPyTypeConstRef   CPyDict_Type ()
MAXON_METHOD CPyTypeConstRef   CPyClass_Type ()
MAXON_METHOD CPyTypeConstRef   CPyTraceBack_Type ()
MAXON_METHOD CPyTypeConstRef   CPySlice_Type ()
MAXON_METHOD CPyTypeConstRef   CPyType_Type ()
MAXON_METHOD CPyTypeConstRef   CPyMemoryView_Type ()
const MAXON_METHOD PyChar ConvertAndCacheString (const String &str, PyStringEncodings encoding, UInt *size=nullptr)
MAXON_METHOD Result < void >  RegisterSpecificPythonClass (const Id &typeId, const CPyTypeRef &type)
MAXON_METHOD Result < void >  PrivateRegisterBuiltinConverter (const DataType &dt, const DelegatePyObject_AsData &f1, const DelegatePyObject_FromData <> &f2)
template<typename T >
MAXON_FUNCTION Result < void >  RegisterBuiltinConverter (const DelegatePyObject_AsData &f1, const DelegatePyObject_FromData < T > &f2)
MAXON_METHOD Url   GetSpecialPath ( SPECIALPATH )
MAXON_METHOD void  RegisterSpecialPath ( SPECIALPATH , const Url &path)
MAXON_METHOD CPyTypeConstRef   MPyDataCapsule_Type ()
MAXON_METHOD CPyTypeConstRef   CPyData_Type ()
MAXON_METHOD CPyTypeConstRef   CPyCapsule_Type ()
MAXON_METHOD CPyRef   PrivateGetCurrentCallerContext ()
MAXON_METHOD CPyRef   MPyDataType_ToMapperInstance (const CPyRef &capsule)
MAXON_METHOD CPyRef   MPyData_ToMapperInstance (const MPyDataRef &capsule)
MAXON_METHOD CPyRef   CPyObject_ToMapperInstance (const DataType &dt, const CPyRef &capsule)
MAXON_METHOD Result < void >  AssociateDataTypeWithPythonTypes (const DataType &dt, const CPyRef &type)
MAXON_METHOD Result < CPyRef GetAssociatedDataType (const DataType &dt)
MAXON_METHOD DelegatePyObject_FromData GetConverterPyObject_FromData (const DataType &dt)
MAXON_METHOD MPyDataRef   MPyData_New ( 数据 &data)
MAXON_METHOD MPyDataRef   MPyData_New (const DataType &dt, Generic *data, Bool owner, const DataType &mapDt= DataType::NullValue ())
MAXON_METHOD MPyDataTypeRef   MPyDataType_New (const DataType &dt)
MAXON_METHOD Bool   MPyDataType_CheckExact (const CPyRef &o) const
const MAXON_METHOD DataType MPyDataType_GetDataType (const MPyDataTypeRef &o) const
MAXON_METHOD Bool   MPyData_CheckExact (const CPyRef &o) const
MAXON_METHOD Result < 数据 * >  CPyObject_AsData ( Int stackDepth, const CPyRef &obj, const DataType &expected, BlockArray < 数据 > &k, BaseArray < reflection::Argument > *n=nullptr)
MAXON_METHOD Result < BaseArray < TYPE_CONVERSION_TUPLE > >  GetRegisteredTypesWithConversions ()
template<typename T >
MAXON_FUNCTION std::enable_if< STD_IS_REPLACEMENT (same, T, DataType ), ResultPtr < DataType > >::type  ParseArgument (const CPyRef &args, Int32 argIndex, Bool isOptional=false)
template<typename T >
MAXON_FUNCTION Result < T >  ParseRef (const CPyRef &args, Int32 argIndex, Bool isOptional=false)
template<typename T >
MAXON_FUNCTION std::enable_if< STD_IS_REPLACEMENT (reference, T)|| STD_IS_REPLACEMENT (pointer, T), Result < T > >::type  ParseArgument (const CPyRef &args, BlockArray < 数据 > &tempStack, Int32 argIndex, Bool isOptional=false)
template<typename T >
MAXON_FUNCTION std::enable_if<! STD_IS_REPLACEMENT (reference, T) &&! STD_IS_REPLACEMENT (pointer, T), Result < T > >::type  ParseArgument (const CPyRef &args, BlockArray < 数据 > &tempStack, Int32 argIndex, Bool isOptional=false)
MAXON_METHOD Result < DataType ParseDataType (const CPyRef &args, Int32 argIndex, Bool canBeNone=false)
template<typename T >
MAXON_FUNCTION Result < T >  ParseGeneric (const CPythonLibraryRef &pylib, const CPyRef &args, Int32 argIndex, DataType &dt, Bool unpackData)
MAXON_METHOD void  SetError (const Error &err)
MAXON_METHOD void  SetError (const ErrorPtr &err)
MAXON_METHOD CPyRef   MaxonConvertAuto (const CPyRef &capsule)
MAXON_METHOD CPyRef   CPyObject_FromGeneric (const DataType &origDt, const Generic *object, OWNERSHIP ownership, const CPyTypeRef *expected=nullptr, Int *count=nullptr)
MAXON_METHOD CPyRef   CreateGlobalDictionary () const
MAXON_METHOD Result < BaseArray < SourceLocation > >  GetCurrentTraceback ()
template<typename T >
MAXON_FUNCTION CPyRef   Enum_ToMapperInstance (T enumm)
MAXON_METHOD Class < CPyRef GetCPyRefClass () const
MAXON_METHOD Class < CPyTypeRef GetCPyTypeRefClass () const
MAXON_METHOD Class < CPyFrameRef GetCPyFrameRefClass () const
MAXON_METHOD Class < CPyTracebackRef GetCPyTracebackRefClass () const
MAXON_METHOD Class < CPyCodeRef GetCPyCodeRefClass () const
MAXON_METHOD Class < MPyClassRef GetMPyClassRefClass () const
MAXON_METHOD Class < MPyMemberRef GetMPyMemberRefClass () const
MAXON_METHOD Class < MPyFunctionRef GetMPyFunctionRefClass () const
MAXON_METHOD Class < MPyDataTypeRef GetMPyDataTypeRefClass () const
MAXON_METHOD Class < MPyDataRef GetMPyDataRefClass () const
MAXON_METHOD Class < MPyCallerContextRef GetMPyCallerContextRefClass () const

静态公共成员函数

static MAXON_METHOD Result < PYSTARTOPERATION ParseCommandLine ( BaseArray < String > *args=nullptr, 数据 *res=nullptr, PYTHONFLAG *flags=nullptr)
static MAXON_METHOD Result < void >  GetUrl ( DEFAULTRUNTIME pythonPath, Url &pythonLibrary, Url &pythonHome)

私有成员函数

  MAXON_INTERFACE ( CPythonLibraryInterface , MAXON_REFERENCE_NORMAL , "net.maxon.python.interface.python.cpythonlibrary")

Member Typedef Documentation

◆  TYPE_CONVERSION_TUPLE

using TYPE_CONVERSION_TUPLE = Tuple < DataType , DelegatePyObject_AsData , DelegatePyObject_FromData <> >

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( CPythonLibraryInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.python.interface.python.cpythonlibrary"   
)
private

◆  ParseCommandLine()

static MAXON_METHOD Result < PYSTARTOPERATION > ParseCommandLine ( BaseArray < String > *  args = nullptr ,
数据 res = nullptr ,
PYTHONFLAG flags = nullptr  
)
static

◆  Init()

MAXON_METHOD Result <void> Init ( const Url librarypath ,
Bool   createSubLibrary  
)

Initializes a new library object. Must not be called on the pre-allocated Python instances!

参数
[in] librarypath Path to the Python library.
[in] createSubLibrary True to create a sub-interpreter.
返回
OK on success.

◆  InitTypes()

MAXON_METHOD Result <void> InitTypes ( )

Initializes all types after proper initialization. Must not be called on the pre-allocated Python instances!

返回
OK on success.

◆  InitBuiltinModules()

MAXON_METHOD Result <void> InitBuiltinModules ( )

Initializes all builtin modules after initialization. Must not be called on the pre-allocated Python instances!

返回
OK on success.

◆  CPy_Initialize()

MAXON_METHOD void CPy_Initialize ( )

Initializes Python. Must not be called on the pre-allocated Python instances!

◆  CPy_Finalize()

MAXON_METHOD void CPy_Finalize ( )

Finalizes Python. Must not be called on the pre-allocated Python instances!

◆  CPyModule_Create()

MAXON_METHOD CPyRef CPyModule_Create ( const ModuleDefinition module )

Initialize a Python module by the information passed in the module definition. GIL must be held.

参数
[in] module Information about the builtin module.
返回
参考

◆  Free()

MAXON_METHOD void Free ( const Delegate < void()> &  shutdownEngine )

Free all resources and internals of Python. Must not be called on the pre-allocated Python instances!

参数
[in] shutdownEngine Delegate which must execute Py_Finalize. GIL got released.

◆  GetDll()

const MAXON_METHOD PythonDll & GetDll ( ) const

Meta information of Python library.

返回
Meta information object.

◆  FopenNative()

MAXON_METHOD FILE_native * FopenNative ( const Char name ,
const Char mode  
)

Should be used whenever the native Python API requires a FILE pointer. Whenever a Python library function takes a FILE pointer it must be guaranteed that a valid FILE object is passed. When Python is for instance compiled with VS2012 and the host application is compiled with VS2013 the FILE object must not be mixed between runtimes (msvcr110.dll != msvcr120.dll). The FILE object must always be from the same runtime. PythonLibrary::FopenNative() and PythonLibrary::fclose() guarantee that always the correct FILE structure is created.

参数
[in] name Name object of fopen(name, ...)
[in] mode File mode, like fopen(..., "rb");
返回
File object or nullptr on failure.

◆  LastPythonCallFailed()

MAXON_METHOD Error LastPythonCallFailed ( MAXON_SOURCE_LOCATION_DECLARATION   ,
Bool   withTraceback ,
Bool   restoreError  
)

Returns a Python error with an AggregatedError which is aggreated with PythonTracebackErrors.

参数
[in] restoreError True to keep the exception indicator untouched, or False to keep the exception indicator.
返回
PythonError.

◆  RegisterComponentProxy()

MAXON_METHOD Result < MPyDataRef > RegisterComponentProxy ( const CPyRef type ,
const Id registryId ,
const ProxyDefinition baseAndInterfaceIds ,
const Id cid ,
Bool   printErrors ,
ClassInterface::KIND   kind ,
const SourceLocation loc ,
Bool   createObject ,
const DataType dtOfObject  
)

Register a proxy component for virtual-, and non-virtual interfaces and adds the object to the Classes registry. Used internally by the Python counterpart of MAXON_COMPONENT_OBJECT_REGISTER and MAXON_COMPONENT_CLASS_REGISTER to register a Python type. GIL must be held.

参数
[in] type Python type which represents the implementation.
[in] registryId Optional ID to which registry the object should be published to, can be empty.
[in] baseAndInterfaceIds Definition object with information about the baseclasses and interfaces the type implements.
[in] cid ID of the object, e.g. "net.maxon.iohandler.gzip"
[in] printErrors True if the error of a failed Python function should be printed to the console, otherwise false. If false, all exceptions within the overwritten functions must be handled for exceptions properly.
[in] kind KIND type of the class.
[in] loc Location information where the object got registered from.
[in] createObject True to create and publish a new instance in the registry instead of the class. True for MAXON_COMPONENT_OBJECT_REGISTER, and false for MAXON_COMPONENT_CLASS_REGISTER.
[in] dtOfObject Necessary information of which type the ObjectRef instance is.
返回
MPyDataRef of the new class object.

◆  CPy_IsInitialized()

MAXON_METHOD Bool CPy_IsInitialized ( )

Returns true when Python has been initialized, otherwise False.

返回
True or False.

◆  CPy_GetVersion()

const MAXON_METHOD Char * CPy_GetVersion ( )

Return the version of this Python interpreter. The value is available to Python code as sys.version.

返回
Version string.

◆  CPy_GetPlatform()

const MAXON_METHOD Char * CPy_GetPlatform ( )

Return the platform identifier for the current platform. The value is available to Python code as sys.platform.

返回
Platform string.

◆  CPy_GetCopyright()

const MAXON_METHOD Char * CPy_GetCopyright ( )

Return the official copyright string The value is available to Python code as sys.copyright.

返回
Copright string.

◆  CPy_GetCompiler()

const MAXON_METHOD Char * CPy_GetCompiler ( )

Return an indication of the compiler used to build the current Python version. The value is available to Python code as part of the variable sys.version.

返回
Copright string.

◆  CPy_GetBuildInfo()

const MAXON_METHOD Char * CPy_GetBuildInfo ( )

Return information about the sequence number and build date and time of the current Python interpreter instance. The value is available to Python code as part of the variable sys.version.

返回
Build info.

◆  CPy_SetProgramName()

MAXON_METHOD Result <void> CPy_SetProgramName ( const String name )

This function should be called before Py_Initialize() is called for the first time.

参数
[in] name Name for the current program.

◆  CPy_SetPythonHome()

MAXON_METHOD Result <void> CPy_SetPythonHome ( const Url name )

Set the default "home" directory, that is, the location of the standard Python libraries.

参数
[in] name Name for the current program.

◆  CPy_GetProgramName()

MAXON_METHOD String CPy_GetProgramName ( )

Return the program name set with Py_SetProgramName(), or the default.

返回
Program name.

◆  CPy_GetPythonHome()

MAXON_METHOD String CPy_GetPythonHome ( )

Return the default "home", that is, the value set by a previous call to Py_SetPythonHome().

返回
Python home.

◆  ExecuteModule()

MAXON_METHOD Bool ExecuteModule ( const String name )

Executes a Python module by its name. GIL must be held.

参数
[in] name Name of the module.
返回
True on success, otherwise false. Exception indicator is cleared before function returns.

◆  CPyCallerContext_New()

MAXON_METHOD MPyCallerContextRef CPyCallerContext_New ( )

Private. Create caller context object which contains a pointer to this object. The context gets passed to all C-functions as the first self parameter. This is used in PrivateExtractCPythonLibrary{XX} to achieve the convenient wrapping method for C++ functions. GIL must be held.

返回
New caller context.

◆  CPyRun_SimpleFileExFlags() [1/2]

MAXON_METHOD Bool CPyRun_SimpleFileExFlags ( FILE_native fp ,
const Char filename ,
Int32   closeit ,
CPyCompilerFlags flags  
)

Executes the Python source code from a file. If ' main ' does not already exist, it is created. If the function fails, Checks for CPyErr_Occured and clear the exception indicator of Python accordingly. GIL must be held.

参数
[in] fp File pointer where to read the source from.
[in] filename Path of the file.
[in] closeit True if Python should close the pointer using fclose, otherwise false.
[in] flags Optional compiler flags. Can be nullptr.
返回
True on success.

◆  CPyRun_SimpleFileExFlags() [2/2]

MAXON_METHOD Bool CPyRun_SimpleFileExFlags ( const Url url ,
CPyCompilerFlags flags  
)

Executes the Python source code from a file. If ' main ' does not already exist, it is created. If the function fails, Checks for CPyErr_Occured and clear the exception indicator of Python accordingly. GIL must be held.

参数
[in] url Url where the source is read from.
[in] flags Optional compiler flags. Can be nullptr.
返回
True on success.

◆  CPyRun_SimpleStringFlags()

MAXON_METHOD CPyRef CPyRun_SimpleStringFlags ( const String code ,
CPyCompilerFlags flags  
)

Executes the Python source code from a source string. If the function fails, Checks for CPyErr_Occured and clear the exception indicator of Python accordingly. GIL must be held.

参数
[in] code Python source code.
[in] flags Optional compiler flags. Can be nullptr.
返回
True on success.

◆  CPyRun_FileExFlags()

MAXON_METHOD NativePyObject * CPyRun_FileExFlags ( FILE_native fp ,
const Char filename ,
Int32   start ,
NativePyObject globals ,
NativePyObject locals ,
Int32   closeit ,
CPyCompilerFlags flags  
)

Execute Python source code from fp in the context specified by the objects globals and locals with the compiler flags specified by flags. locals must be a dictionary; locals can be any object that implements the mapping protocol. The parameter start specifies the start token that should be used to parse the source code.If the function fails, Checks for CPyErr_Occured and clear the exception indicator of Python accordingly. GIL must be held.

参数
[in] fp File pointer where to read the source from.
[in] filename Path of the file.
[in] start Key start like PY_FILE_INPUT
[in] globals Dict object.
[in] locals Any object that implements the mapping protocol.
[in] closeit True if Python should close the pointer using fclose, otherwise false.
[in] flags Optional compiler flags. Can be nullptr.
返回
True on success.

◆  CPyRun_InteractiveLoopFlags()

MAXON_METHOD Result <void> CPyRun_InteractiveLoopFlags ( FILE *  fp ,
const Char filename ,
CPyCompilerFlags flags  
)

Enters the interactive loop of the Python interpreter. If an exception occurrs, it stays in the loop. Only a sys.exit() will exit the function with OK. Raises exceptions only for internal errors. GIL must be held.

参数
[in] fp File stream of the input stream, normally stdin.
[in] filename Name of the interactive loop.
[in] flags Optional compiler flags. Can be nullptr.
返回
OK on success, and sys.exit().

◆  CPyGilState_Ensure()

MAXON_METHOD PYGILSTATE CPyGilState_Ensure ( )

Ensure that the current thread is ready to call the Python C API regardless of the current state of Python, or of the global interpreter lock. See https://docs.python.org/2/c-api/init.html#c.PyGILState_Ensure 了解更多信息。

返回
GIL state.

◆  CPyGilState_Release()

MAXON_METHOD void CPyGilState_Release ( PYGILSTATE   state )

Release any resources previously acquired. After this call, Python's state will be the same as it was prior to the corresponding CPyGILState_Ensure() call. GIL must be held. See https://docs.python.org/2/c-api/init.html#c.PyGILState_Release 了解更多信息。

参数
[in] state GIL state.

◆  GetGilState()

MAXON_METHOD GILSTATE GetGilState ( ) const

Returns the current GIL state.

返回
Current GIL state.

◆  CPyGILState_GetThisThreadState()

MAXON_METHOD NativePyThreadState * CPyGILState_GetThisThreadState ( )

Returns the current thread state object.

返回
Thread state object or nullptr if no thread state object is available.

◆  CPyThreadState_Swap()

MAXON_METHOD NativePyThreadState * CPyThreadState_Swap ( NativePyThreadState state )

Swap the current thread state with the passed one.

参数
state Thread State to swap with.
返回
Old thread state.

◆  CPyThreadState_GetDict()

MAXON_METHOD CPyRef CPyThreadState_GetDict ( )

Get the dictionary of the current thread state.

返回
Dict of the current thread state.

◆  CPy_CompileStringFlags()

MAXON_METHOD CPyCodeRef CPy_CompileStringFlags ( const Char code ,
const Char filename ,
PYINPUT   start ,
CPyCompilerFlags flags = nullptr  
)

Parse and compile a given Python source code returning the resulting code object. GIL must be held.

参数
[in] code Python source code.
[in] filename Filename of the code object and might appear in the traceback or SyntaxError exception messages.
[in] start Start token.
[in] flags Optional compiler flags. Can be nullptr.

◆  CPy_Incref()

MAXON_METHOD void CPy_Incref ( NativePyObject o ) const

Increments the reference count for object o. The object must not be nullptr. GIL must be held. See https://docs.python.org/2/c-api/refcounting.html#c.Py_INCREF 了解更多信息。

参数
[in] o Object to increment its reference count from.

◆  CPy_Decref()

MAXON_METHOD void CPy_Decref ( NativePyObject o ) const

Decrements the reference count for object o. The object must not be nullptr. GIL must be held. See https://docs.python.org/2/c-api/refcounting.html#c.Py_DECREF 了解更多信息。

参数
[in] o Object to decrement its reference count from.

◆  CPy_SafeIncref()

MAXON_METHOD void CPy_SafeIncref ( NativePyObject o ) const

Increments the reference count for object o. If the object is nullptr, the call has no effect. GIL must be held. See https://docs.python.org/2/c-api/refcounting.html#c.Py_XINCREF 了解更多信息。

参数
[in] o Object to decrement its reference count from.

◆  CPy_SafeDecref()

MAXON_METHOD void CPy_SafeDecref ( NativePyObject o ) const

Decrements the reference count for object o. If the object is nullptr, the call has no effect. GIL must be held. See https://docs.python.org/2/c-api/refcounting.html#c.Py_XDECREF 了解更多信息。

参数
[in] o Object to decrement its reference count from.

◆  CPy_SafeClear()

MAXON_FUNCTION void CPy_SafeClear ( T *&  o ) const

◆  CPyGC_Collect()

MAXON_METHOD Int64 CPyGC_Collect ( )

Runs the garbage collector of Python. GIL must be held.

返回
Number of items collected

◆  CPyCode_Addr2Line()

MAXON_METHOD Int32 CPyCode_Addr2Line ( const CPyCodeRef codeObject ,
Int32   x  
)

Returns the line number of a code object with a given instruction.

参数
[in] codeObject Code object.
[in] x Instruction in bytes.
返回
Line number or -1 on failure.

◆  UnpackDataType()

MAXON_METHOD CPyRef UnpackDataType ( const CPyRef obj )

Returns the internal DataType capsule of a maxon.DataType object. GIL must be held.

参数
[in] obj Object of type maxon.DataType .
返回
DataType capsule. Can be safely casted to MPyDataType

◆  UnpackData()

MAXON_METHOD CPyRef UnpackData ( const CPyRef obj )

Returns the internal 数据 capsule of a maxon.Data object. GIL must be held.

参数
[in] obj Object of type maxon.Data .
返回
数据 capsule. Can be safely casted to MPyData

◆  CPy_None()

MAXON_METHOD CPyConstRef CPy_None ( ) const

Returns a None object. GIL must be held.

返回
None object.

◆  CPy_True()

MAXON_METHOD CPyConstRef CPy_True ( ) const

Returns a False object. GIL must be held.

返回
False object.

◆  CPy_False()

MAXON_METHOD CPyConstRef CPy_False ( ) const

Returns a True object. GIL must be held.

返回
True object.

◆  CPy_NotImplemented()

MAXON_METHOD CPyConstRef CPy_NotImplemented ( ) const

Returns the not implemented value object. GIL must be held.

返回
NotImplemented (is not the same as NotImplementedError)

◆  CPyErr_Print()

MAXON_METHOD void CPyErr_Print ( )

Print a standard traceback to sys.stderr and clear the error indicator. Call this function only when the error indicator is set (Otherwise it will cause a fatal error!). GIL must be held.

◆  CPyErr_Clear()

MAXON_METHOD void CPyErr_Clear ( )

Clears the error indicator of Python. If the error indicator is not set, the call has no effect. GIL must be held.

◆  CPyErr_Occurred()

MAXON_METHOD Bool CPyErr_Occurred ( CPyRef type = nullptr )

Checks if the error indicator is set. GIL must be held.

参数
[out] type Private. Exception type.
返回
True if the error indicator is set, otherwise false.

◆  CPyErr_SetString() [1/2]

MAXON_METHOD CPyRef CPyErr_SetString ( const CPyRef errorType ,
const Char errorString = nullptr  
)

Sets the error indicator. GIL must be held.

参数
[in] errorType Exception type object.
[in] errorString Human readbale exception message.
返回
Always returns an empty CPyRef 对象。

◆  CPyErr_SetWithErrnoAndFilename()

MAXON_METHOD CPyRef CPyErr_SetWithErrnoAndFilename ( const CPyRef errorType ,
Int32   errorNumber ,
const Char filename  
)

Sets the error indicator with a filename and errno. GIL must be held.

参数
[in] errorType Exception type object.
[in] errorNumber Error indicator.
[in] filename Filename 对象。
返回
Always returns an empty CPyRef 对象。

◆  CPyErr_SetWithErrno()

MAXON_METHOD CPyRef CPyErr_SetWithErrno ( const CPyRef errorType ,
Int32   errorNumber  
)

Sets the error indicator. GIL must be held.

参数
[in] errorType Exception type object.
[in] errorNumber Error indicator.
返回
Always returns an empty CPyRef 对象。

◆  CPyErr_SetString() [2/2]

MAXON_METHOD CPyRef CPyErr_SetString ( const CPyRef errorType ,
const String errorString  
)

Sets the error indicator. GIL must be held.

参数
[in] errorType Exception type object.
[in] errorString Human readbale exception message.
返回
Always returns an empty CPyRef 对象。

◆  CPyErr_SetNone()

MAXON_METHOD void CPyErr_SetNone ( const CPyRef errorType )

Sets the error indicator without a message. GIL must be held.

参数
[in] errorType Exception type object.

◆  CPyErr_Fetch()

MAXON_METHOD void CPyErr_Fetch ( CPyRef type ,
CPyRef value ,
CPyRef traceback  
)

Retrieve the error indicator into three variables whose addresses are passed. If the error indicator is not set, all three objects are empty.

参数
[out] type Exception type.
[out] value Exception value.
[out] traceback Traceback object.

◆  CPyErr_NormalizeException()

MAXON_METHOD void CPyErr_NormalizeException ( CPyRef type ,
CPyRef value ,
CPyRef traceback  
)

Normalizes the objects, retrieved by CPyErr_Fetched. See https://docs.python.org/2/c-api/exceptions.html#c.PyErr_NormalizeException 了解更多信息。

参数
[out] type Exception type.
[out] value Exception value.
[out] traceback Traceback object.

◆  CPyErr_Restore()

MAXON_METHOD void CPyErr_Restore ( const CPyRef type ,
const CPyRef value ,
const CPyRef traceback  
)

Restores the exception which got retrieved by CPyErr_Fetch.

参数
[in] type Exception type.
[in] value Exception value.
[in] traceback Traceback object.

◆  CPyErr_ExceptionMatches()

MAXON_METHOD Bool CPyErr_ExceptionMatches ( const CPyRef exc )

Checks if the current set exception is of a given exception.

参数
[in] exc A given object.
返回
True when equal, otherwise false.

◆  CPyExceptionClass_Check()

MAXON_METHOD Bool CPyExceptionClass_Check ( const CPyRef o )

Checks if the given object is an exception. GIL must be held.

参数
[in] o A given object.
返回
True if o is an exception.

◆  CPyCapsule_New()

MAXON_METHOD CPyRef CPyCapsule_New ( void *  pointer ,
const Char name ,
CPyCapsule_Destructor destructor  
) const

Create a capsule encapsulating a given pointer. The pointer argument may not be nullptr. GIL must be held.

参数
[in] pointer Pointer to encapsulate.
[in] name Name of the capsule.
[in] destructor Function pointer which gets called on destruction of the capsule.
返回
capsule object.

◆  CPyCapsule_SetPointer()

MAXON_METHOD Bool CPyCapsule_SetPointer ( const CPyRef capsule ,
void *  pointer  
)

Set the pointer of the capsule. GIL must be held.

参数
[in] capsule Capsule object.
[in] pointer Set, or overwrite the pointer of the capsule.
返回
True on success.

◆  CPyCapsule_GetPointer()

MAXON_METHOD void* CPyCapsule_GetPointer ( const CPyRef capsule ,
const Char name  
)

Retrieve the pointer stored in the capsule. On failure, returns nullptr. GIL must be held.

参数
[in] capsule Capsule to extract the pointer from.
[in] name Name of the capsule. On mismatch, the function returns nullptr.
返回
Pointer from capsule.

◆  CPyCapsule_GetContext()

MAXON_METHOD void* CPyCapsule_GetContext ( const CPyRef capsule )

Retrieve the context stored in the capsule, which was set by CPyCapsule_SetContext. On failure, returns nullptr. GIL must be held.

参数
[in] capsule Capsule to extract the context from.
返回
Pointer to the capsule.

◆  CPyCapsule_SetContext()

MAXON_METHOD Bool CPyCapsule_SetContext ( const CPyRef capsule ,
void *  context  
)

Set a context pointer to a capsule. GIL must be held.

参数
[in] capsule Set, or overwrite the pointer of the capsule.
返回
Context pointer.

◆  CPyCapsule_CheckExact()

MAXON_METHOD Bool CPyCapsule_CheckExact ( const CPyRef o )

Checks if the given object is a capsule. GIL must be held.

参数
[in] o A given object.
返回
True if o is a capsule.

◆  CPyTraceBack_Check()

MAXON_METHOD Bool CPyTraceBack_Check ( const CPyRef o )

Checks if the given object is a traceback. GIL must be held.

参数
[in] o A given object.
返回
True if o is a traceback.

◆  CPyClass_Check()

MAXON_METHOD Bool CPyClass_Check ( const CPyRef o )

Checks if the given object is a class. GIL must be held.

参数
[in] o A given object.
返回
True if o is a class.

◆  CPyTuple_New()

MAXON_METHOD CPyRef CPyTuple_New ( UInt   size ) const

Creates a new immutable tuple. The tuple must be initialized right after it got created by using CPyTuple_SetItem. GIL must be held.

参数
[in] size Size of the new tuple.
返回
New tuple or empty object if if exception indicator is set.

◆  CPyTuple_Size()

MAXON_METHOD UInt CPyTuple_Size ( const CPyRef tuple )

Returns the size of a tuple. GIL must be held. GIL must be held.

返回
Size of the tuple, or -1 if exception indicator is set.

◆  CPyTuple_GetItem()

MAXON_METHOD CPyRef CPyTuple_GetItem ( const CPyRef tuple ,
UInt   index  
)

Retrieves an item of a tuple by its index. GIL must be held.

参数
[in] tuple Tuple 对象。
[in] index Index of the element. Raises an IndexError, if index is out of range.
返回
Element of the item at the given index, or empty object if exception indicator is set.

◆  CPyTuple_SetItem()

MAXON_METHOD Bool CPyTuple_SetItem ( const CPyRef tuple ,
UInt   index ,
const CPyRef item  
)

Sets an item in a tuple at a given index. GIL must be held.

参数
[in] tuple Tuple 对象。
[in] index Index of the element. Raises an IndexError, if index is out of range.
[in] item Item to set.
返回
True on success. Returns false if exception indicator is set.

◆  CPyTuple_GetSlice()

MAXON_METHOD CPyRef CPyTuple_GetSlice ( const CPyRef tuple ,
UInt   from ,
UInt   to  
)

Retrieves a slice object from a given slice range. GIL must be held.

参数
[in] tuple Tuple 对象。
[in] from Start index (including the object at this given index).
[in] to End index (excluding the object at this given index).
返回
Slice objector empty object if exception indicator is set.

◆  CPyTuple_CheckExact()

MAXON_METHOD Bool CPyTuple_CheckExact ( const CPyRef tuple )

Checks if a given object is a tuple. GIL must be held.

参数
[in] tuple Tuple 对象。
返回
True if o is a tuple.

◆  CPyObject_HasAttrString()

MAXON_METHOD Bool CPyObject_HasAttrString ( const CPyRef o ,
const Char attrName  
)

Checks if a given object has a specific attribute name. Equivalent to getattr(o, "name"). GIL must be held.

参数
[in] o Object to Checks the attribute for.
[in] attrName Name of the attribute.
返回
True on match, otherwise False.

◆  CPyObject_SetAttrString()

MAXON_METHOD Bool CPyObject_SetAttrString ( const CPyRef o ,
const Char name ,
const CPyRef item  
)

Sets the value of the attribute named attrName, for object o, to the value item. GIL must be held.

参数
[in] o Object which will get the attribute.
[in] name Name of the attribute.
[in] item Value of the attribute.
返回
True on success, otherwise False if the exception indicator is set.

◆  CPyObject_GetAttrString()

MAXON_METHOD CPyRef CPyObject_GetAttrString ( const CPyRef o ,
const Char name  
)

Gets the attribute of an object by an attribute name. GIL must be held.

参数
[in] o Object to get the attribute from.
[in] name Name of the attribute.
返回
Attribute on success or empty object if attribute could not be found and exception indicator is set.

◆  CPyObject_Call()

MAXON_METHOD CPyRef CPyObject_Call ( const CPyRef callable_object ,
const CPyRef tupleArg ,
const CPyRef kw  
)

Calls an object with optional argument list or a keyword dictionary. GIL must be held.

参数
[in] callable_object Object to call.
[in] tupleArg Argument list. Can be empty.
[in] kw Dictionary list. Can be empty.
返回
Result or empty object if the call failed and the exception indicator got set.

◆  CPyObject_Str()

MAXON_METHOD CPyRef CPyObject_Str ( const CPyRef o )

Computes a string representation of an object. Equivalent to str(o). GIL must be held.

参数
[in] o Object to stringify.
返回
Result or empty object if the call failed and the exception indicator got set.

◆  CPyObject_Repr()

MAXON_METHOD CPyRef CPyObject_Repr ( const CPyRef o )

Computes a string representation of an object. Equivalent to repr(o). GIL must be held.

参数
[in] o Object to stringify.
返回
Result or empty object if the call failed and the exception indicator got set.

◆  CPyObject_Dir()

MAXON_METHOD CPyRef CPyObject_Dir ( const CPyRef o )

Gets the internal dictionary of an object. Equivalent to dir(o). GIL must be held.

参数
[in] o Object to get the dictionary from..
返回
Result or empty object if the call failed and the exception indicator got set.

◆  CPyObject_RichCompare()

MAXON_METHOD CPyRef CPyObject_RichCompare ( const CPyRef o1 ,
const CPyRef o2 ,
Int32   opid  
)

Rich compares two objects with each other and returns its result. Equivalent to "o1 op o2". GIL must be held.

参数
[in] o1 Left operand.
[in] o2 Right operand.
返回
Result or empty object if the call failed and the exception indicator got set.

◆  CPyObject_Hash()

MAXON_METHOD Int64 CPyObject_Hash ( const CPyRef o )

Computes the hash of an object. Equivalent to hash(o). GIL must be held.

参数
[in] o Left operand.
返回
The hash or -1 if the exception indicator got set.

◆  CPyObject_IsTrue()

MAXON_METHOD Bool CPyObject_IsTrue ( const CPyRef o )

Returns true if the object is considered to be true, and false otherwise. This is equivalent to the Python expression 'not not o'. GIL must be held.

参数
[in] o Left operand.
返回
True if the object is true, otherwise false.

◆  CPyObject_Not()

MAXON_METHOD Bool CPyObject_Not ( const CPyRef o )

Returns false if the object is considered to be true, and true otherwise. This is equivalent to the Python expression 'not o'. GIL must be held.

参数
[in] o Left operand.
返回
True if the object is true, otherwise false.

◆  CPyCallable_Check()

MAXON_METHOD Bool CPyCallable_Check ( const CPyRef o )

Checks if a given object is a callable. GIL must be held.

参数
[in] o A given object.
返回
True if o is callable.

◆  CPyObject_Length()

MAXON_METHOD Int CPyObject_Length ( const CPyRef o )

Returns the length of an object. GIL must be held.

参数
[in] o A given object.
返回
Length or -1 if the exception indicator is set.

◆  CPyObject_GetItem()

MAXON_METHOD CPyRef CPyObject_GetItem ( const CPyRef o ,
const CPyRef key  
)

Gets the item of an object. Equivalent to getitem(o). GIL must be held.

参数
[in] o Object.
[in] key Key object.
返回
Result object or empty object if the exception indicator got set.

◆  CPyObject_GetItemInt()

MAXON_METHOD CPyRef CPyObject_GetItemInt ( const CPyRef o ,
Int   index  
)

Gets the item of an object by an index. Equivalent to getitem(o, intValue). GIL must be held.

参数
[in] o Object.
[in] index Int key.
返回
Result object or empty object if the exception indicator got set.

◆  CPyObject_GetItemString()

MAXON_METHOD CPyRef CPyObject_GetItemString ( const CPyRef o ,
const Char index  
)

Gets the item of an object by a string. Equivalent to getitem(o, strValue). GIL must be held.

参数
[in] o Object.
[in] index String key.
返回
Result object or empty object if the exception indicator got set.

◆  CPyObject_DelItem()

MAXON_METHOD Bool CPyObject_DelItem ( const CPyRef o ,
const CPyRef key  
)

Deletes an item of an object by a given key.

参数
[in] o Object.
[in] key Object key.
返回
True on success, or false if the exception indicator got set.

◆  CPyObject_SetItem()

MAXON_METHOD Bool CPyObject_SetItem ( const CPyRef o ,
const CPyRef key ,
const CPyRef item  
)

Sets an item to an object at a given key. Equivalent to o[key]. GIL must be held.

参数
[in] o Object.
[in] key String key.
[in] item Object item.
返回
True on success, or false if the exception indicator got set.

◆  CPyObject_TypeCheck()

MAXON_METHOD Bool CPyObject_TypeCheck ( const CPyRef object ,
const CPyTypeRef type  
)

Check if a given object is of a certain type.

参数
[in] object Object to check.
[in] type Type object.
返回
True on match, otherwise False.

◆  CPyObject_CallFunction()

MAXON_METHOD CPyRef CPyObject_CallFunction ( const CPyRef o )

Calls an object. Equivalent to o(). GIL must be held.

参数
[in] o Object to call.
返回
Result object or empty object if the exception indicator got set.

◆  CPySys_GetObject()

MAXON_METHOD CPyRef CPySys_GetObject ( const Char name )

Retrieves an object from the sys module by its name. GIL must be held.

参数
[in] name Name of the object.
返回
Result object or empty object if the exception indicator got set.

◆  CPySys_SetObject()

MAXON_METHOD Bool CPySys_SetObject ( const Char name ,
const CPyRef o  
)

Sets an object to the sys module. GIL must be held.

参数
[in] name Name of the object.
[in] o Object to set.
返回
True on success, or false if the exception indicator got set.

◆  CPy_SetPath()

MAXON_METHOD Result <void> CPy_SetPath ( const BaseArray < Url > &  paths )

Sets an array of paths to sys.path. GIL must be held.

参数
[in] paths Array of paths to set. None of the elements must be empty.
返回
OK on success or error, if the exception indicator got set.

◆  CPySys_SetPath()

MAXON_METHOD Result <void> CPySys_SetPath ( const BaseArray < Url > &  paths ,
PATHHANDLE   add  
)

Sets an array of paths to sys.path. GIL must be held.

参数
[in] paths Array of paths to set. None of the elements must be empty.
[in] add Mode of the operation.
返回
OK on success or error, if the exception indicator got set.

◆  CPySys_SetArgvEx()

MAXON_METHOD Result <void> CPySys_SetArgvEx ( const BaseArray < String > &  args ,
Bool   updatepath  
)

Sets the arguments to sys.argv.

参数
[in] args New arguments.
[in] updatepath Bool to update sys.path, otherwise false.
返回
OK on success or error, if the exception indicator got set.

◆  CPySys_GetPath()

MAXON_METHOD BaseArray < Url > CPySys_GetPath ( )

Returns an array of URLs which are in sys.path.

返回
Array of Url 对象。

◆  CPySite_AddSiteDir()

MAXON_METHOD Result <void> CPySite_AddSiteDir ( const Url siteDir )

Adds a directory to sys.path and process its .pth files.

参数
[in] siteDir Directory to add.
返回
OK on success.

◆  CPyUnicode_Check()

MAXON_METHOD Bool CPyUnicode_Check ( const CPyRef o )

Checks if the given object is a str or a subtype of StringType. GIL must be held.

参数
[in] o A given object.
返回
True if o is a str.

◆  CPyUnicode_FromString()

MAXON_METHOD CPyRef CPyUnicode_FromString ( const Char str ) const

Converts a given string to a string object. GIL must be held.

参数
[in] str String constant.
返回
String object or empty object if the exception indicator got set.

◆  CPyUnicode_FromStringAndSize()

MAXON_METHOD CPyRef CPyUnicode_FromStringAndSize ( const Block < const Char > &  block )

Converts a given block to a string object. GIL must be held.

参数
[in] block Char block.
返回
String object or empty object if the exception indicator got set.

◆  CPyUnicode_AsString()

MAXON_METHOD Result < String > CPyUnicode_AsString ( const CPyRef str )

Converts a string object to a string. GIL must be held.

参数
[in] str String 对象。
返回
String or error if the exception indicator got set.

◆  CPyUnicode_AsCString()

const MAXON_METHOD Char * CPyUnicode_AsCString ( const CPyRef str )

Retrieves the pointer to a chary array of a string object. The char array is alive as long as the string object is alive. Until the string object gets deleted, the char array will be deleted too. GIL must be held.

参数
[in] str String 对象。
返回
Pointer to char array, or nullptr if the the exception indicator got set.

◆  CPyUnicode_GetLength()

MAXON_METHOD Int CPyUnicode_GetLength ( const CPyRef str )

Gets the size of a string. GIL must be held.

参数
[in] str String 对象。
返回
Length or -1 if the exception indicator got set.

◆  CPyObject_GetIter()

MAXON_METHOD CPyRef CPyObject_GetIter ( const CPyRef o ) const

Gets the iterator of an object. Equivalent to iter(o). GIL must be held.

参数
[in] o Object to get the iterator from/
返回
Iterator object.

◆  CPyIter_Next()

MAXON_METHOD CPyRef CPyIter_Next ( const CPyRef it ) const

Iterate next in an iterator. Equivalent to next(it)

参数
[in] it Iterator object.
返回
Next object or empty object if the exception indicator is set. If the last element got reached, StopIteration is set.

◆  CPyDict_New()

MAXON_METHOD CPyRef CPyDict_New ( ) const

Creates a new empty dictionary. GIL must be held.

返回
Dictionary object.

◆  CPyDict_GetItem()

MAXON_METHOD CPyRef CPyDict_GetItem ( const CPyRef dict ,
const CPyRef key ,
Bool   raiseKeyError  
)

Gets the item of a dictionary. GIL must be held.

参数
[in] dict Dict object.
[in] key Key object.
[in] raiseKeyError True to raise a KeyError if the item was not found, otherwise false and only an empty object is returned.
返回
Value of the passed key. Depending on raiseKeyError, an exception is set if the key was found, or not.

◆  CPyDict_GetItemString()

MAXON_METHOD CPyRef CPyDict_GetItemString ( const CPyRef dict ,
const Char key ,
Bool   raiseKeyError  
)

Gets the item of a dictionary by a given key string.

参数
[in] dict Dict object.
[in] key Key string.
[in] raiseKeyError True to raise a KeyError if the item was not found, otherwise false and only an empty object is returned.
返回
Value of the passed key. Depending on raiseKeyError, an exception is set if the key was found, or not.

◆  CPyDict_SetItem()

MAXON_METHOD Bool CPyDict_SetItem ( const CPyRef dict ,
const CPyRef key ,
const CPyRef item  
)

Sets an item to a dictionary. GIL must be held.

参数
[in] dict Dict object.
[in] key Key object.
[in] item Value item.
返回
True on sucess, or false if the exception indicator got set.

◆  CPyDict_DelItem()

MAXON_METHOD Bool CPyDict_DelItem ( const CPyRef dict ,
const CPyRef key  
)

Deletes an item from a dictionary. GIL must be held.

参数
[in] dict Dict object.
[in] key Key object.
返回
True on sucess, or false if the item was not found and the exception indicator got set.

◆  CPyDict_Contains()

MAXON_METHOD CONTAINS CPyDict_Contains ( const CPyRef dict ,
const CPyRef key  
)

◆  CPyDict_Clear()

MAXON_METHOD void CPyDict_Clear ( const CPyRef dict )

Removes all elements from the dictionary. GIL must be held.

参数
[in] dict Dict object.

◆  CPyDict_Next()

MAXON_METHOD Bool CPyDict_Next ( const CPyRef dict ,
Int pos ,
CPyRef key ,
CPyRef value  
)

Goes to the next element in the dictionary, starting from a given index.

参数
[in] dict Dict object.
[in,out] pos Index start and gets incremented by one when the function leaves.
[in] key Key object.
[in] value Value object.
返回
True on sucess, or false if the item was not found and the exception indicator got set.

◆  CPyDict_Keys()

MAXON_METHOD CPyRef CPyDict_Keys ( const CPyRef dict )

Gets all keys of a dictionary in a list. GIL must be held.

参数
[in] dict Dict object.
返回
List of keys.

◆  CPyDict_Values()

MAXON_METHOD CPyRef CPyDict_Values ( const CPyRef dict )

Gets all values of a dictionary in a list. GIL must be held.

参数
[in] dict Dict object.
返回
List of values.

◆  CPyDict_Items()

MAXON_METHOD CPyRef CPyDict_Items ( const CPyRef dict )

Gets all items of a dictionary in a list. GIL must be held.

参数
[in] dict Dict object.
返回
List of items.

◆  CPyDict_Size()

MAXON_METHOD Int CPyDict_Size ( const CPyRef dict )

Return the number of items in the dictionary. This is equivalent to len(p) on a dictionary. GIL must be held.

参数
[in] dict Dict object.
返回
Number of items.

◆  CPyDict_Copy()

MAXON_METHOD CPyRef CPyDict_Copy ( const CPyRef dict )

Gets a copy of a given dictionary. Does not make a deepcopy. GIL must be held.

参数
[in] dict Dict object.
返回
Number of items.

◆  CPyDict_SetItemString()

MAXON_METHOD Bool CPyDict_SetItemString ( const CPyRef dict ,
const Char key ,
const CPyRef item  
) const

Sets an item to a dictionary at a given key.

参数
[in] dict Dict object.
[in] key String key.
[in] item Item to set.
返回
True on sucess, or false if the exception indicator got set.

◆  CPyDict_Check()

MAXON_METHOD Bool CPyDict_Check ( const CPyRef o ) const

Checks if the given object is a dict. GIL must be held.

参数
[in] o A given object.
返回
True if o is a dict.

◆  CPyList_New()

MAXON_METHOD CPyRef CPyList_New ( UInt   size )

Creates a new list of a certain size. GIL must be held.

参数
[in] size Size of the list.
返回
New list object.

◆  CPyList_CheckExact()

MAXON_METHOD Bool CPyList_CheckExact ( const CPyRef list )

Checks if a list is a list. No subtype check is performed. GIL must be held.

参数
[in] list Object to check.
返回
True if the object is a list, otherwise false.

◆  CPyList_Size()

MAXON_METHOD Int CPyList_Size ( const CPyRef list )

◆  CPyList_GetItem()

MAXON_METHOD CPyRef CPyList_GetItem ( const CPyRef list ,
UInt   index  
)

◆  CPyList_SetItem()

MAXON_METHOD Bool CPyList_SetItem ( const CPyRef list ,
UInt   ,
const CPyRef item  
)

◆  CPyList_Insert()

MAXON_METHOD Bool CPyList_Insert ( const CPyRef list ,
UInt   ,
const CPyRef item  
)

◆  CPyList_Append()

MAXON_METHOD Bool CPyList_Append ( const CPyRef list ,
const CPyRef item  
)

◆  CPyList_GetSlice()

MAXON_METHOD CPyRef CPyList_GetSlice ( const CPyRef list ,
UInt   from ,
UInt   to  
)

◆  CPyList_SetSlice()

MAXON_METHOD Bool CPyList_SetSlice ( const CPyRef list ,
UInt   from ,
UInt   to ,
const CPyRef item  
)

◆  CPyList_Sort()

MAXON_METHOD Bool CPyList_Sort ( const CPyRef list )

◆  CPyList_Reverse()

MAXON_METHOD Bool CPyList_Reverse ( const CPyRef list )

◆  CPyList_AsTuple()

MAXON_METHOD CPyRef CPyList_AsTuple ( const CPyRef list )

◆  CPyDict_DelItemString()

MAXON_METHOD Bool CPyDict_DelItemString ( const CPyRef p ,
const Char key  
)

◆  CPyModule_Check()

MAXON_METHOD Bool CPyModule_Check ( const CPyRef o )

Checks if the given object is a module. GIL must be held.

参数
[in] o A given object.
返回
True if o is a module.

◆  CPyModule_AddObject()

MAXON_METHOD Bool CPyModule_AddObject ( const CPyRef module ,
const Char name ,
const CPyRef value  
)

◆  CPyModule_GetDict()

MAXON_METHOD CPyRef CPyModule_GetDict ( const CPyRef module )

◆  CPyModule_AddIntConstant()

MAXON_METHOD Bool CPyModule_AddIntConstant ( const CPyRef mod ,
const Char name ,
long  value  
)

◆  CPyImport_ImportModule()

MAXON_METHOD CPyRef CPyImport_ImportModule ( const Char name )

import

◆  CPyImport_GetImporter()

MAXON_METHOD CPyRef CPyImport_GetImporter ( const CPyRef path )

◆  CPyImport_GetModuleDict()

MAXON_METHOD CPyRef CPyImport_GetModuleDict ( )

◆  CPyType_Check()

MAXON_METHOD Bool CPyType_Check ( const CPyRef o )

Checks if the given object is a type. GIL must be held.

参数
[in] o A given object.
返回
True if o is a type.

◆  CPyType_IsSubtype()

MAXON_METHOD Bool CPyType_IsSubtype ( const CPyTypeRef a ,
const CPyTypeRef b  
)

Checks if a type is really a subclass, subclasscheck () is not called. An object is not a subtype of its own class. Use CPyObject_IsSubtype instead. GIL must be held.

参数
[in] a Base type.
[in] b Subtype type.
返回
Returns true if a is a subtype of b.

◆  CPyType_HasFeature()

MAXON_METHOD Bool CPyType_HasFeature ( const CPyTypeRef type ,
Int64   f  
) const

Checks if a type has a certain feature.

参数
[in] type Type object.
[in] f Feature value.
返回
True if the type supports this feature or false if not.

◆  CPyType_FastSubclass()

MAXON_METHOD Bool CPyType_FastSubclass ( const CPyTypeRef type ,
Int64   f  
) const

Performs a quick subtype check.

参数
[in] type Type object.
[in] f Subtype value.
返回
True if the type is of the given subtype or false if not.

◆  CPyType_GetName()

MAXON_METHOD Result < String > CPyType_GetName ( const CPyTypeRef type )

Returns the name of a given type.

参数
[in] type Type object.
返回
Name of the type or error if the exception indicator got set.

◆  CPyType_Ready()

MAXON_METHOD Bool CPyType_Ready ( CPyTypeRef type )

Initializes a type.

参数
[in] type Type object to initialize.
返回
True on success.

◆  CPyEval_SaveThread()

MAXON_METHOD NativePyThreadState * CPyEval_SaveThread ( )

Release the global interpreter lock

返回
Previous state object.

◆  CPyEval_RestoreThread()

MAXON_METHOD void CPyEval_RestoreThread ( NativePyThreadState state )

Restores a given thread state object.

参数
[in] state Thread state object.

◆  CPyEval_ThreadsInitialized()

MAXON_METHOD Bool CPyEval_ThreadsInitialized ( )

Checks if multi-threading for Python is enabled.

返回
True if available.

◆  CPyEval_InitThreads()

MAXON_METHOD void CPyEval_InitThreads ( )

Private. Initializes multi-threading for the Python library. Must not be called on the pre-allocated Python instances!

◆  CPyEval_AcquireThread()

MAXON_METHOD void CPyEval_AcquireThread ( NativePyThreadState state )

Acquires the GIL for a thread state object.

参数
[in] state Thread state object.

◆  CPyEval_ReleaseThread()

MAXON_METHOD void CPyEval_ReleaseThread ( NativePyThreadState state )

Releases the GIL for a thread state object.

参数
[in] state Thread state object.

◆  CPyEval_ReInitThreads()

MAXON_METHOD void CPyEval_ReInitThreads ( )

Private. Reinitializes the multi-threading. Must not be called on the pre-allocated Python instances!

◆  CPyEval_GetBuiltins()

MAXON_METHOD CPyRef CPyEval_GetBuiltins ( ) const

Returns the builtins of Python

返回
Builtins.

◆  CPyEval_EvalCode()

MAXON_METHOD CPyRef CPyEval_EvalCode ( const CPyCodeRef code ,
const CPyRef globals ,
const CPyRef locals  
) const

Executes a given code object in the given globals, and locals dictionary.

参数
[in] code Code object to execute.
[in] globals Global scope.
[in] locals Local scope.
返回
Result object or empty object if the exception indicator got set.

◆  CPyFloat_Check()

MAXON_METHOD Bool CPyFloat_Check ( const CPyRef o )

Checks if the given object is a float. GIL must be held.

参数
[in] o A given object.
返回
True if o is a float.

◆  CPyFloat_FromFloat32()

MAXON_METHOD CPyRef CPyFloat_FromFloat32 ( Float32   value )

Creates a float object from a Float32.

参数
[in] value Float32 value.
返回
bool object.

◆  CPyFloat_FromFloat64()

MAXON_METHOD CPyRef CPyFloat_FromFloat64 ( Float64   value )

Creates a float object from a Float64.

参数
[in] value Float64 value.
返回
bool object.

◆  CPyFloat_AsFloat64()

MAXON_METHOD Float64 CPyFloat_AsFloat64 ( const CPyRef o )

Converts a float object to Float64.

参数
[in] o Object to convert.
返回
Result or -1 if the exception indicator got set.

◆  CPyFloat_As()

MAXON_FUNCTION T CPyFloat_As ( const CPyRef o )

Converts an object to a floating type.

Template Parameters
T Floating type.
参数
[in] o Object to convert.
返回
Result 值。

◆  CPyFloat_From() [1/2]

MAXON_FUNCTION CPyRef CPyFloat_From ( std::enable_if_t< STD_IS_REPLACEMENT (same, T, Float32 ), Float32 o )

Converts an object from a Float32 value.

参数
[in] o Float value.
返回
Float object.

◆  CPyFloat_From() [2/2]

MAXON_FUNCTION CPyRef CPyFloat_From ( std::enable_if_t< STD_IS_REPLACEMENT (same, T, Float64 ), Float64 o )

Converts an object from a Float64 value.

参数
[in] o Float value.
返回
Float object.

◆  CPyLong_Check()

MAXON_METHOD Bool CPyLong_Check ( const CPyRef o )

Checks if the given object is an int or a subtype of PyLong_Type. GIL must be held.

参数
[in] o A given object.
返回
True if o is a

◆  CPyBool_FromBool()

MAXON_METHOD CPyRef CPyBool_FromBool ( Bool   value )

Creates a bool object from a Bool.

参数
[in] value Bool value.
返回
bool object.

◆  CPyLong_FromInt16()

MAXON_METHOD CPyRef CPyLong_FromInt16 ( Int16   value )

Creates an int object from a Int16 value.

参数
[in] value Int value.
返回
Int object.

◆  CPyLong_FromUInt16()

MAXON_METHOD CPyRef CPyLong_FromUInt16 ( UInt16   value )

Creates an int object from a UInt16 value.

参数
[in] value Int value.
返回
Int object.

◆  CPyLong_FromInt32()

MAXON_METHOD CPyRef CPyLong_FromInt32 ( Int32   value )

Creates an int object from a Int32 value.

参数
[in] value Int value.
返回
Int object.

◆  CPyLong_FromUInt32()

MAXON_METHOD CPyRef CPyLong_FromUInt32 ( UInt32   value )

Creates an int object from a UInt32 value.

参数
[in] value Int value.
返回
Int object.

◆  CPyLong_FromInt64()

MAXON_METHOD CPyRef CPyLong_FromInt64 ( Int64   value )

Creates an int object from a Int64 value.

参数
[in] value Int value.
返回
Int object.

◆  CPyLong_FromUInt64()

MAXON_METHOD CPyRef CPyLong_FromUInt64 ( UInt64   value )

Creates an int object from a UInt64 value. GIL must be held.

参数
[in] value Int value.
返回
Int object.

◆  CPyLong_AsInt16()

MAXON_METHOD Int16 CPyLong_AsInt16 ( const CPyRef o )

Converts an object to an Int16 value. GIL must be held.

参数
[in] o Object to convert.
返回
Integer value, or -1 if the exception indicator got set.

◆  CPyLong_AsUInt16()

MAXON_METHOD UInt16 CPyLong_AsUInt16 ( const CPyRef o )

Converts an object to an UInt16 value. GIL must be held.

参数
[in] o Object to convert.
返回
Integer value, or -1 if the exception indicator got set.

◆  CPyLong_AsInt32()

MAXON_METHOD Int32 CPyLong_AsInt32 ( const CPyRef o )

Converts an object to an Int32 value. GIL must be held.

参数
[in] o Object to convert.
返回
Integer value, or -1 if the exception indicator got set.

◆  CPyLong_AsUInt32()

MAXON_METHOD UInt32 CPyLong_AsUInt32 ( const CPyRef o )

Converts an object to an UInt32 value. GIL must be held.

参数
[in] o Object to convert.
返回
Integer value, or -1 if the exception indicator got set.

◆  CPyLong_AsInt64()

MAXON_METHOD Int64 CPyLong_AsInt64 ( const CPyRef o )

Converts an object to an Int64 value. GIL must be held.

参数
[in] o Object to convert.
返回
Integer value, or -1 if the exception indicator got set.

◆  CPyLong_AsUInt64()

MAXON_METHOD UInt64 CPyLong_AsUInt64 ( const CPyRef o )

Converts an object to an UInt64 value. GIL must be held.

参数
[in] o Object to convert.
返回
Integer value, or -1 if the exception indicator got set.

◆  CPyLong_As()

MAXON_FUNCTION T CPyLong_As ( const CPyRef o )

Converts an object to type T. GIL must be held.

Template Parameters
T Integral type.
参数
[in] o Object to convert.
返回
Result 值。

◆  CPyLong_From() [1/2]

MAXON_FUNCTION CPyRef CPyLong_From ( std::enable_if_t< std::is_same< T, Int32 >::value, Int32 o )

Converts an object from an Int32 value. GIL must be held.

参数
[in] o Int value.
返回
Int object.

◆  CPyLong_From() [2/2]

MAXON_FUNCTION CPyRef CPyLong_From ( std::enable_if_t< std::is_same< T, Int64 >::value, Int64 o )

Converts an object from an Int64 value. GIL must be held.

参数
[in] o Int64 value.
返回
Int object.

◆  CPyNumber_Check()

MAXON_METHOD Bool CPyNumber_Check ( const CPyRef o )

Checks if the given object is a numeric object. GIL must be held.

参数
[in] o Object to check.
返回
True if an object is a numeric value.

◆  MPyFunction_New()

MAXON_METHOD MPyFunctionRef MPyFunction_New ( const reflection::Function func )

Creates a function capsule that encapsulates a reflection::Function pointer.

参数
[in] func Function pointer to encapsulate.
返回
New function capsule or empty object if the exception indicator got set.

◆  MPyMember_New()

MAXON_METHOD MPyMemberRef MPyMember_New ( const reflection::Member member )

Creates a member capsule that encapsulates a reflection::Member pointer.

参数
[in] member Member pointer to encapsulate.
返回
New member capsule or empty object if the exception indicator got set.

◆  CPyMem_SetAllocator()

MAXON_METHOD Result <void> CPyMem_SetAllocator ( CPyMemAllocatorDomain   domain ,
CPyMemAllocatorEx allocator  
)

Set a custom memory allocator. See https://docs.python.org/3/c-api/memory.html#c.PyMem_SetAllocator .

◆  MPyClass_New()

MAXON_METHOD MPyClassRef MPyClass_New ( const reflection::Class cls )

Creates a class capsule that encapsulates a reflection::Member pointer.

参数
[in] cls Class pointer to encapsulate.
返回
New class capsule or empty object if the exception indicator got set.

◆  CPy_DebugFlag()

MAXON_METHOD Int32 * CPy_DebugFlag ( )

Returns a mutable pointer to a DebugFlag. Can be nullptr if the flag is not available in this Python version.

返回
DebugFlag flag

◆  CPy_VerboseFlag()

MAXON_METHOD Int32 * CPy_VerboseFlag ( )

Returns a mutable pointer to a VerboseFlag. Can be nullptr if the flag is not available in this Python version.

返回
VerboseFlag flag

◆  CPy_InteractiveFlag()

MAXON_METHOD Int32 * CPy_InteractiveFlag ( )

Returns a mutable pointer to a InteractiveFlag. Can be nullptr if the flag is not available in this Python version.

返回
InteractiveFlag flag

◆  CPy_InspectFlag()

MAXON_METHOD Int32 * CPy_InspectFlag ( )

Returns a mutable pointer to a InspectFlag. Can be nullptr if the flag is not available in this Python version.

返回
InspectFlag flag

◆  CPy_OptimizeFlag()

MAXON_METHOD Int32 * CPy_OptimizeFlag ( )

Returns a mutable pointer to a OptimizeFlag. Can be nullptr if the flag is not available in this Python version.

返回
OptimizeFlag flag

◆  CPy_NoSiteFlag()

MAXON_METHOD Int32 * CPy_NoSiteFlag ( )

Returns a mutable pointer to a NoSiteFlag. Can be nullptr if the flag is not available in this Python version.

返回
NoSiteFlag flag

◆  CPy_BytesWarningFlag()

MAXON_METHOD Int32 * CPy_BytesWarningFlag ( )

Returns a mutable pointer to a BytesWarningFlag. Can be nullptr if the flag is not available in this Python version.

返回
BytesWarningFlag flag

◆  CPy_FrozenFlag()

MAXON_METHOD Int32 * CPy_FrozenFlag ( )

Returns a mutable pointer to a FrozenFlag. Can be nullptr if the flag is not available in this Python version.

返回
FrozenFlag flag

◆  CPy_IgnoreEnvironmentFlag()

MAXON_METHOD Int32 * CPy_IgnoreEnvironmentFlag ( )

Returns a mutable pointer to a IgnoreEnvironmentFlag. Can be nullptr if the flag is not available in this Python version.

返回
IgnoreEnvironmentFlag flag

◆  CPy_DontWriteBytecodeFlag()

MAXON_METHOD Int32 * CPy_DontWriteBytecodeFlag ( )

Returns a mutable pointer to a DontWriteBytecodeFlag. Can be nullptr if the flag is not available in this Python version.

返回
DontWriteBytecodeFlag flag

◆  CPy_NoUserSiteDirectory()

MAXON_METHOD Int32 * CPy_NoUserSiteDirectory ( )

Returns a mutable pointer to a NoUserSiteDirectory. Can be nullptr if the flag is not available in this Python version.

返回
NoUserSiteDirectory flag

◆  CPyExc_BaseException()

MAXON_METHOD CPyConstRef CPyExc_BaseException ( )

Returns the BaseException.

返回
The BaseException exception.

◆  CPyExc_Exception()

MAXON_METHOD CPyConstRef CPyExc_Exception ( )

Returns the Exception.

返回
The Exception exception.

◆  CPyExc_StopIteration()

MAXON_METHOD CPyConstRef CPyExc_StopIteration ( )

Returns the StopIteration.

返回
The StopIteration exception.

◆  CPyExc_GeneratorExit()

MAXON_METHOD CPyConstRef CPyExc_GeneratorExit ( )

Returns the GeneratorExit.

返回
The GeneratorExit exception.

◆  CPyExc_StandardError()

MAXON_METHOD CPyConstRef CPyExc_StandardError ( )

Returns the StandardError.

返回
The StandardError exception.

◆  CPyExc_ArithmeticError()

MAXON_METHOD CPyConstRef CPyExc_ArithmeticError ( )

Returns the ArithmeticError.

返回
The ArithmeticError exception.

◆  CPyExc_LookupError()

MAXON_METHOD CPyConstRef CPyExc_LookupError ( )

Returns the LookupError.

返回
The LookupError exception.

◆  CPyExc_AssertionError()

MAXON_METHOD CPyConstRef CPyExc_AssertionError ( )

Returns the AssertionError.

返回
The AssertionError exception.

◆  CPyExc_AttributeError()

MAXON_METHOD CPyConstRef CPyExc_AttributeError ( )

Returns the AttributeError.

返回
The AttributeError exception.

◆  CPyExc_EOFError()

MAXON_METHOD CPyConstRef CPyExc_EOFError ( )

Returns the EOFError.

返回
The EOFError exception.

◆  CPyExc_FloatingPointError()

MAXON_METHOD CPyConstRef CPyExc_FloatingPointError ( )

Returns the FloatingPointError.

返回
The FloatingPointError exception.

◆  CPyExc_EnvironmentError()

MAXON_METHOD CPyConstRef CPyExc_EnvironmentError ( )

Returns the EnvironmentError.

返回
The EnvironmentError exception.

◆  CPyExc_IOError()

MAXON_METHOD CPyConstRef CPyExc_IOError ( )

Returns the IOError.

返回
The IOError exception.

◆  CPyExc_OSError()

MAXON_METHOD CPyConstRef CPyExc_OSError ( )

Returns the OSError.

返回
The OSError exception.

◆  CPyExc_ImportError()

MAXON_METHOD CPyConstRef CPyExc_ImportError ( )

Returns the ImportError.

返回
The ImportError exception.

◆  CPyExc_IndexError()

MAXON_METHOD CPyConstRef CPyExc_IndexError ( )

Returns the IndexError.

返回
The IndexError exception.

◆  CPyExc_KeyError()

MAXON_METHOD CPyConstRef CPyExc_KeyError ( )

Returns the KeyError.

返回
The KeyError exception.

◆  CPyExc_KeyboardInterrupt()

MAXON_METHOD CPyConstRef CPyExc_KeyboardInterrupt ( )

Returns the KeyboardInterrupt.

返回
The KeyboardInterrupt exception.

◆  CPyExc_MemoryError()

MAXON_METHOD CPyConstRef CPyExc_MemoryError ( )

Returns the MemoryError.

返回
The MemoryError exception.

◆  CPyExc_NameError()

MAXON_METHOD CPyConstRef CPyExc_NameError ( )

Returns the NameError.

返回
The NameError exception.

◆  CPyExc_OverflowError()

MAXON_METHOD CPyConstRef CPyExc_OverflowError ( )

Returns the OverflowError.

返回
The OverflowError exception.

◆  CPyExc_RuntimeError()

MAXON_METHOD CPyConstRef CPyExc_RuntimeError ( )

Returns the RuntimeError.

返回
The RuntimeError exception.

◆  CPyExc_NotImplementedError()

MAXON_METHOD CPyConstRef CPyExc_NotImplementedError ( )

Returns the NotImplementedError.

返回
The NotImplementedError exception.

◆  CPyExc_SyntaxError()

MAXON_METHOD CPyConstRef CPyExc_SyntaxError ( )

Returns the SyntaxError.

返回
The SyntaxError exception.

◆  CPyExc_IndentationError()

MAXON_METHOD CPyConstRef CPyExc_IndentationError ( )

Returns the IndentationError.

返回
The IndentationError exception.

◆  CPyExc_TabError()

MAXON_METHOD CPyConstRef CPyExc_TabError ( )

Returns the TabError.

返回
The TabError exception.

◆  CPyExc_ReferenceError()

MAXON_METHOD CPyConstRef CPyExc_ReferenceError ( )

Returns the ReferenceError.

返回
The ReferenceError exception.

◆  CPyExc_SystemError()

MAXON_METHOD CPyConstRef CPyExc_SystemError ( )

Returns the SystemError.

返回
The SystemError exception.

◆  CPyExc_SystemExit()

MAXON_METHOD CPyConstRef CPyExc_SystemExit ( )

Returns the SystemExit.

返回
The SystemExit exception.

◆  CPyExc_TypeError()

MAXON_METHOD CPyConstRef CPyExc_TypeError ( )

Returns the TypeError.

返回
The TypeError exception.

◆  CPyExc_UnboundLocalError()

MAXON_METHOD CPyConstRef CPyExc_UnboundLocalError ( )

Returns the UnboundLocalError.

返回
The UnboundLocalError exception.

◆  CPyExc_UnicodeError()

MAXON_METHOD CPyConstRef CPyExc_UnicodeError ( )

Returns the UnicodeError.

返回
The UnicodeError exception.

◆  CPyExc_UnicodeEncodeError()

MAXON_METHOD CPyConstRef CPyExc_UnicodeEncodeError ( )

Returns the UnicodeEncodeError.

返回
The UnicodeEncodeError exception.

◆  CPyExc_UnicodeDecodeError()

MAXON_METHOD CPyConstRef CPyExc_UnicodeDecodeError ( )

Returns the UnicodeDecodeError.

返回
The UnicodeDecodeError exception.

◆  CPyExc_UnicodeTranslateError()

MAXON_METHOD CPyConstRef CPyExc_UnicodeTranslateError ( )

Returns the UnicodeTranslateError.

返回
The UnicodeTranslateError exception.

◆  CPyExc_ValueError()

MAXON_METHOD CPyConstRef CPyExc_ValueError ( )

Returns the ValueError.

返回
The ValueError exception.

◆  CPyExc_ZeroDivisionError()

MAXON_METHOD CPyConstRef CPyExc_ZeroDivisionError ( )

Returns the ZeroDivisionError.

返回
The ZeroDivisionError exception.

◆  CPyExc_WindowsError()

MAXON_METHOD CPyConstRef CPyExc_WindowsError ( )

Returns the WindowsError.

返回
The WindowsError exception.

◆  CPyExc_BufferError()

MAXON_METHOD CPyConstRef CPyExc_BufferError ( )

Returns the BufferError.

返回
The BufferError exception.

◆  CPyExc_MemoryErrorInst()

MAXON_METHOD CPyConstRef CPyExc_MemoryErrorInst ( )

Returns the MemoryErrorInst.

返回
The MemoryErrorInst exception.

◆  CPyExc_RecursionErrorInst()

MAXON_METHOD CPyConstRef CPyExc_RecursionErrorInst ( )

Returns the RecursionErrorInst.

返回
The RecursionErrorInst exception.

◆  CPyExc_Warning()

MAXON_METHOD CPyConstRef CPyExc_Warning ( )

Returns the Warning.

返回
The Warning exception.

◆  CPyExc_UserWarning()

MAXON_METHOD CPyConstRef CPyExc_UserWarning ( )

Returns the UserWarning.

返回
The UserWarning exception.

◆  CPyExc_DeprecationWarning()

MAXON_METHOD CPyConstRef CPyExc_DeprecationWarning ( )

Returns the DeprecationWarning.

返回
The DeprecationWarning exception.

◆  CPyExc_PendingDeprecationWarning()

MAXON_METHOD CPyConstRef CPyExc_PendingDeprecationWarning ( )

Returns the PendingDeprecationWarning.

返回
The PendingDeprecationWarning exception.

◆  CPyExc_SyntaxWarning()

MAXON_METHOD CPyConstRef CPyExc_SyntaxWarning ( )

Returns the SyntaxWarning.

返回
The SyntaxWarning exception.

◆  CPyExc_RuntimeWarning()

MAXON_METHOD CPyConstRef CPyExc_RuntimeWarning ( )

Returns the RuntimeWarning.

返回
The RuntimeWarning exception.

◆  CPyExc_FutureWarning()

MAXON_METHOD CPyConstRef CPyExc_FutureWarning ( )

Returns the FutureWarning.

返回
The FutureWarning exception.

◆  CPyExc_ImportWarning()

MAXON_METHOD CPyConstRef CPyExc_ImportWarning ( )

Returns the ImportWarning.

返回
The ImportWarning exception.

◆  CPyExc_UnicodeWarning()

MAXON_METHOD CPyConstRef CPyExc_UnicodeWarning ( )

Returns the UnicodeWarning.

返回
The UnicodeWarning exception.

◆  CPyExc_BytesWarning()

MAXON_METHOD CPyConstRef CPyExc_BytesWarning ( )

Returns the BytesWarning.

返回
The BytesWarning exception.

◆  CPyNullImporter_Type()

MAXON_METHOD CPyTypeConstRef CPyNullImporter_Type ( )

Returns the CPyNullItype of CPyNullImporter.

返回
Type of CPyNullImporter.

◆  CPySuper_Type()

MAXON_METHOD CPyTypeConstRef CPySuper_Type ( )

Returns the Ctype of CPySuper.

返回
Type of CPySuper.

◆  CPyBool_Type()

MAXON_METHOD CPyTypeConstRef CPyBool_Type ( )

Returns the type of CPyBool.

返回
Type of CPyBool.

◆  CPyObject_Type()

MAXON_METHOD CPyTypeConstRef CPyObject_Type ( )

Returns the CPtype of CPyObject.

返回
Type of CPyObject.

◆  CPyModule_Type()

MAXON_METHOD CPyTypeConstRef CPyModule_Type ( )

Returns the CPtype of CPyModule.

返回
Type of CPyModule.

◆  CPyUnicode_Type()

MAXON_METHOD CPyTypeConstRef CPyUnicode_Type ( )

Returns the CPtype of CPyUnicode.

返回
Type of CPyUnicode.

◆  CPyLong_Type()

MAXON_METHOD CPyTypeConstRef CPyLong_Type ( )

Returns the type of CPyLong.

返回
Type of CPyLong.

◆  CPyFloat_Type()

MAXON_METHOD CPyTypeConstRef CPyFloat_Type ( )

Returns the Ctype of CPyFloat.

返回
Type of CPyFloat.

◆  CPyTuple_Type()

MAXON_METHOD CPyTypeConstRef CPyTuple_Type ( )

Returns the Ctype of CPyTuple.

返回
Type of CPyTuple.

◆  CPyList_Type()

MAXON_METHOD CPyTypeConstRef CPyList_Type ( )

Returns the type of CPyList.

返回
Type of CPyList.

◆  CPyDict_Type()

MAXON_METHOD CPyTypeConstRef CPyDict_Type ( )

Returns the type of CPyDict.

返回
Type of CPyDict.

◆  CPyClass_Type()

MAXON_METHOD CPyTypeConstRef CPyClass_Type ( )

Returns the Ctype of CPyClass.

返回
Type of CPyClass.

◆  CPyTraceBack_Type()

MAXON_METHOD CPyTypeConstRef CPyTraceBack_Type ( )

Returns the CPyTrtype of CPyTraceBack.

返回
Type of CPyTraceBack.

◆  CPySlice_Type()

MAXON_METHOD CPyTypeConstRef CPySlice_Type ( )

Returns the Ctype of CPySlice.

返回
Type of CPySlice.

◆  CPyType_Type()

MAXON_METHOD CPyTypeConstRef CPyType_Type ( )

Returns the type of CPyType.

返回
Type of CPyType.

◆  CPyMemoryView_Type()

MAXON_METHOD CPyTypeConstRef CPyMemoryView_Type ( )

Returns the CPyMemtype of CPyMemoryView.

返回
Type of CPyMemoryView.

◆  ConvertAndCacheString()

const MAXON_METHOD PyChar * ConvertAndCacheString ( const String str ,
PyStringEncodings   encoding ,
UInt size = nullptr  
)

Converts a string with a specific encoding and stores the content for the lifetime of the Python interpreters runtime. Some functions in Python need a string that stays alive for the duration of the Pythons interpreter.

参数
[in] str String to convert.
[in] encoding Encoding to use.
返回
Pointer to the first array of the string sequence. Can be casted to the corresponding code unit type.

◆  RegisterSpecificPythonClass()

MAXON_METHOD Result <void> RegisterSpecificPythonClass ( const Id typeId ,
const CPyTypeRef type  
)

Private.

◆  PrivateRegisterBuiltinConverter()

MAXON_METHOD Result <void> PrivateRegisterBuiltinConverter ( const DataType dt ,
const DelegatePyObject_AsData f1 ,
const DelegatePyObject_FromData <> &  f2  
)

Registers a lambda for back- and forth conversions of certain DataTypes.

参数
[in] dt DataType the converters can handle.
[in] f1 Lambda or function to convert a Python object to a 数据 对象。
[in] f2 Lambda or function which converts a 数据 object to a Python object.
返回
OK on success.

◆  RegisterBuiltinConverter()

MAXON_FUNCTION Result <void> RegisterBuiltinConverter ( const DelegatePyObject_AsData f1 ,
const DelegatePyObject_FromData < T > &  f2  
)

◆  GetUrl()

static MAXON_METHOD Result <void> GetUrl ( DEFAULTRUNTIME   pythonPath ,
Url pythonLibrary ,
Url pythonHome  
)
static

static helper functions

◆  GetSpecialPath()

MAXON_METHOD Url GetSpecialPath ( SPECIALPATH   )

◆  RegisterSpecialPath()

MAXON_METHOD void RegisterSpecialPath ( SPECIALPATH   ,
const Url path  
)

◆  MPyDataCapsule_Type()

MAXON_METHOD CPyTypeConstRef MPyDataCapsule_Type ( )

◆  CPyData_Type()

MAXON_METHOD CPyTypeConstRef CPyData_Type ( )

◆  CPyCapsule_Type()

MAXON_METHOD CPyTypeConstRef CPyCapsule_Type ( )

◆  PrivateGetCurrentCallerContext()

MAXON_METHOD CPyRef PrivateGetCurrentCallerContext ( )

Private.

◆  MPyDataType_ToMapperInstance()

MAXON_METHOD CPyRef MPyDataType_ToMapperInstance ( const CPyRef capsule )

◆  MPyData_ToMapperInstance()

MAXON_METHOD CPyRef MPyData_ToMapperInstance ( const MPyDataRef capsule )

◆  CPyObject_ToMapperInstance()

MAXON_METHOD CPyRef CPyObject_ToMapperInstance ( const DataType dt ,
const CPyRef capsule  
)

◆  AssociateDataTypeWithPythonTypes()

MAXON_METHOD Result <void> AssociateDataTypeWithPythonTypes ( const DataType dt ,
const CPyRef type  
)

◆  GetAssociatedDataType()

MAXON_METHOD Result < CPyRef > GetAssociatedDataType ( const DataType dt )

◆  GetConverterPyObject_FromData()

MAXON_METHOD DelegatePyObject_FromData * GetConverterPyObject_FromData ( const DataType dt )

◆  MPyData_New() [1/2]

MAXON_METHOD MPyDataRef MPyData_New ( 数据 data )

◆  MPyData_New() [2/2]

MAXON_METHOD MPyDataRef MPyData_New ( const DataType dt ,
Generic *  data ,
Bool   owner ,
const DataType mapDt = DataType::NullValue()  
)

◆  MPyDataType_New()

MAXON_METHOD MPyDataTypeRef MPyDataType_New ( const DataType dt )

Creates a DataType capsule. GIL must be held.

参数
dt Pointer of DataType to capsule.
返回
New DataType capsule or empty object if exception indicator is set.

◆  MPyDataType_CheckExact()

MAXON_METHOD Bool MPyDataType_CheckExact ( const CPyRef o ) const

Checks if the given object is a DataType capsule. GIL must be held.

参数
[in] o A given object.
返回
True if o is a DataType capsule.

◆  MPyDataType_GetDataType()

const MAXON_METHOD DataType & MPyDataType_GetDataType ( const MPyDataTypeRef o ) const

Returns the internal DataType pointer of a DataType capsule. GIL must be held.

参数
[in] o DataType capsule.
返回
DataType pointer or nullptr.

◆  MPyData_CheckExact()

MAXON_METHOD Bool MPyData_CheckExact ( const CPyRef o ) const

Checks if the given object is a 数据 capsule. GIL must be held.

参数
[in] o A given object.
返回
True if o is a DataType capsule.

◆  CPyObject_AsData()

MAXON_METHOD Result < 数据 *> CPyObject_AsData ( Int   stackDepth ,
const CPyRef obj ,
const DataType expected ,
BlockArray < 数据 > &  k ,
BaseArray < reflection::Argument > *  n = nullptr  
)

◆  GetRegisteredTypesWithConversions()

MAXON_METHOD Result < BaseArray < TYPE_CONVERSION_TUPLE > > GetRegisteredTypesWithConversions ( )

◆  ParseArgument() [1/3]

MAXON_FUNCTION std::enable_if< STD_IS_REPLACEMENT (same, T, DataType ), ResultPtr < DataType > >::type ParseArgument ( const CPyRef args ,
Int32   argIndex ,
Bool   isOptional = false  
)

◆  ParseRef()

MAXON_FUNCTION Result < T > ParseRef ( const CPyRef args ,
Int32   argIndex ,
Bool   isOptional = false  
)

◆  ParseArgument() [2/3]

MAXON_FUNCTION std::enable_if< STD_IS_REPLACEMENT (reference, T)|| STD_IS_REPLACEMENT (pointer, T), Result < T > >::type ParseArgument ( const CPyRef args ,
BlockArray < 数据 > &  tempStack ,
Int32   argIndex ,
Bool   isOptional = false  
)

◆  ParseArgument() [3/3]

MAXON_FUNCTION std::enable_if<! STD_IS_REPLACEMENT (reference, T) && ! STD_IS_REPLACEMENT (pointer, T), Result <T> >::type ParseArgument ( const CPyRef args ,
BlockArray < 数据 > &  tempStack ,
Int32   argIndex ,
Bool   isOptional = false  
)

if T is not NativePyObject*

◆  ParseDataType()

MAXON_METHOD Result < DataType > ParseDataType ( const CPyRef args ,
Int32   argIndex ,
Bool   canBeNone = false  
)

◆  ParseGeneric()

MAXON_FUNCTION Result < T > ParseGeneric ( const CPythonLibraryRef &  pylib ,
const CPyRef args ,
Int32   argIndex ,
DataType dt ,
Bool   unpackData  
)

◆  SetError() [1/2]

MAXON_METHOD void SetError ( const Error &  err )

◆  SetError() [2/2]

MAXON_METHOD void SetError ( const ErrorPtr err )

◆  MaxonConvertAuto()

MAXON_METHOD CPyRef MaxonConvertAuto ( const CPyRef capsule )

◆  CPyObject_FromGeneric()

MAXON_METHOD CPyRef CPyObject_FromGeneric ( const DataType origDt ,
const Generic *  object ,
OWNERSHIP   ownership ,
const CPyTypeRef expected = nullptr ,
Int count = nullptr  
)

◆  CreateGlobalDictionary()

MAXON_METHOD CPyRef CreateGlobalDictionary ( ) const

Creates a scope dictionary which has all built-in modules preset.

返回
New dictionary object.

◆  GetCurrentTraceback()

MAXON_METHOD Result < BaseArray < SourceLocation > > GetCurrentTraceback ( )

◆  Enum_ToMapperInstance()

MAXON_FUNCTION CPyRef Enum_ToMapperInstance ( enumm )

◆  GetCPyRefClass()

MAXON_METHOD Class < CPyRef > GetCPyRefClass ( ) const

Same As CPyReference37 but preferred.

◆  GetCPyTypeRefClass()

MAXON_METHOD Class < CPyTypeRef > GetCPyTypeRefClass ( ) const

◆  GetCPyFrameRefClass()

MAXON_METHOD Class < CPyFrameRef > GetCPyFrameRefClass ( ) const

◆  GetCPyTracebackRefClass()

MAXON_METHOD Class < CPyTracebackRef > GetCPyTracebackRefClass ( ) const

◆  GetCPyCodeRefClass()

MAXON_METHOD Class < CPyCodeRef > GetCPyCodeRefClass ( ) const

◆  GetMPyClassRefClass()

MAXON_METHOD Class < MPyClassRef > GetMPyClassRefClass ( ) const

◆  GetMPyMemberRefClass()

MAXON_METHOD Class < MPyMemberRef > GetMPyMemberRefClass ( ) const

◆  GetMPyFunctionRefClass()

MAXON_METHOD Class < MPyFunctionRef > GetMPyFunctionRefClass ( ) const

◆  GetMPyDataTypeRefClass()

MAXON_METHOD Class < MPyDataTypeRef > GetMPyDataTypeRefClass ( ) const

◆  GetMPyDataRefClass()

MAXON_METHOD Class < MPyDataRef > GetMPyDataRefClass ( ) const

◆  GetMPyCallerContextRefClass()

MAXON_METHOD Class < MPyCallerContextRef > GetMPyCallerContextRefClass ( ) const