C# 클래스 IronPython.Modules.CTypes

Provides support for interop with native code from Python code.
파일 보기 프로젝트 열기: jschementi/iron 1 사용 예제들

Private Properties

프로퍼티 타입 설명
Cast System.IntPtr
CheckBits int
EmitCDataCreation void
EnsureRefCountTable void
GetFieldInfo void
GetFieldsList IList
GetFunctionType CFuncPtrType
GetHandleFromObject System.IntPtr
GetMarshalTypeFromSize System.Type
IsPointer bool
MakeArrayType System.Reflection.Emit.ArrayType
MakePointer System.Reflection.Emit.PointerType
PerformModuleReload void
StringAt System.IntPtr
StructureCannotContainSelf System.Exception
ValidateArraySizes void
ValidateArraySizes void
ValidateArraySizes void
WStringAt System.IntPtr

공개 메소드들

메소드 설명
@sizeof ( IronPython.Runtime.Types.PythonType type ) : int
@sizeof ( object instance ) : int
CopyComPointer ( object src, object dest ) : int
DeleteCharArrayValue ( _Array arr, object value ) : void
DeleteWCharArrayRaw ( _Array arr ) : object
DeleteWCharArrayValue ( _Array arr ) : object
FormatError ( ) : string
FormatError ( int errorCode ) : string
FreeLibrary ( BigInteger handle ) : void
FreeLibrary ( IntPtr handle ) : void
FreeLibrary ( int handle ) : void
GetCharArrayValue ( _Array arr ) : object
GetWCharArrayRaw ( _Array arr ) : object
GetWCharArrayValue ( _Array arr ) : object
LoadLibrary ( string library, [ mode ) : object
POINTER ( CodeContext context, IronPython.Runtime.Types.PythonType type ) : IronPython.Runtime.Types.PythonType

Returns a new type which represents a pointer given the existing type.

POINTER ( CodeContext context, [ name ) : IronPython.Runtime.Types.PythonType
PyObj_FromPtr ( IntPtr address ) : object

Converts an address acquired from PyObj_FromPtr or that has been marshaled as type 'O' back into an object.

PyObj_ToPtr ( object obj ) : IntPtr

Converts an object into an opaque address which can be handed out to managed code.

Py_DECREF ( object key ) : void

Decreases the ref count on an object which has been increased with Py_INCREF.

Py_INCREF ( object key ) : void

Increases the ref count on an object ensuring that it will not be collected.

SetCharArrayValue ( _Array arr, object value ) : void
SetWCharArrayRaw ( _Array arr, object value ) : void
SetWCharArrayValue ( _Array arr, object value ) : void
_buffer_info ( CData data ) : PythonTuple
_check_HRESULT ( int hresult ) : void
_unpickle ( ) : void
addressof ( CData data ) : object

returns address of C instance internal buffer. It is the callers responsibility to ensure that the provided instance will stay alive if memory in the resulting address is to be used later.

alignment ( IronPython.Runtime.Types.PythonType type ) : int

Gets the required alignment of the given type.

alignment ( object o ) : int

Gets the required alignment of an object.

byref ( CData instance, [ offset ) : object
call_cdeclfunction ( CodeContext context, BigInteger address, PythonTuple args ) : object
call_cdeclfunction ( CodeContext context, IntPtr address, PythonTuple args ) : object
call_cdeclfunction ( CodeContext context, int address, PythonTuple args ) : object
call_commethod ( ) : void
call_function ( CodeContext context, BigInteger address, PythonTuple args ) : object
call_function ( CodeContext context, IntPtr address, PythonTuple args ) : object
call_function ( CodeContext context, int address, PythonTuple args ) : object
dlopen ( string library, [ mode ) : object
get_errno ( ) : int
get_last_error ( ) : int
pointer ( CodeContext context, CData data ) : Pointer

Returns a pointer instance for the given CData

resize ( CData obj, int newSize ) : void
set_conversion_mode ( CodeContext context, string encoding, string errors ) : PythonTuple
set_errno ( ) : void
set_last_error ( int errorCode ) : void

비공개 메소드들

메소드 설명
Cast ( IntPtr data, IntPtr obj, IntPtr type ) : IntPtr

Implementation of our cast function. data is marshalled as a void* so it ends up as an address. obj and type are marshalled as an object so we need to unmarshal them.

CheckBits ( INativeType cdata, PythonTuple pt ) : int

Verifies that the provided bit field settings are valid for this type.

EmitCDataCreation ( INativeType type, ILGenerator method, List constantPool, int constantPoolArgument ) : void

Emits the marshalling code to create a CData object for reverse marshalling.

EnsureRefCountTable ( ) : void
GetFieldInfo ( INativeType type, object o, string &fieldName, INativeType &cdata, int &bitCount ) : void

Shared helper between struct and union for getting field info and validating it.

GetFieldsList ( object fields ) : IList

Shared helper to get the _fields_ list for struct/union and validate it.

GetFunctionType ( CodeContext context, int flags ) : CFuncPtrType
GetHandleFromObject ( object dll, string errorMsg ) : IntPtr
GetMarshalTypeFromSize ( int size ) : Type

Given a specific size returns a .NET type of the equivalent size that we can use when marshalling these values across calls.

IsPointer ( IronPython.Runtime.Types.PythonType pt ) : bool
MakeArrayType ( IronPython.Runtime.Types.PythonType type, int count ) : ArrayType
MakePointer ( CodeContext context, string name, PythonDictionary dict ) : PointerType
PerformModuleReload ( IronPython.Runtime.PythonContext context, PythonDictionary dict ) : void
StringAt ( IntPtr src, int len ) : IntPtr

Helper function for translating from memset to NT's FillMemory API.

StructureCannotContainSelf ( ) : Exception
ValidateArraySizes ( IronPython.Modules.ArrayModule array, int offset, int size ) : void
ValidateArraySizes ( System.Bytes bytes, int offset, int size ) : void
ValidateArraySizes ( int arraySize, int offset, int size ) : void
WStringAt ( IntPtr src, int len ) : IntPtr

Helper function for translating from memset to NT's FillMemory API.

메소드 상세

@sizeof() 공개 정적인 메소드

public static @sizeof ( IronPython.Runtime.Types.PythonType type ) : int
type IronPython.Runtime.Types.PythonType
리턴 int

@sizeof() 공개 정적인 메소드

public static @sizeof ( object instance ) : int
instance object
리턴 int

CopyComPointer() 공개 정적인 메소드

public static CopyComPointer ( object src, object dest ) : int
src object
dest object
리턴 int

DeleteCharArrayValue() 공개 정적인 메소드

public static DeleteCharArrayValue ( _Array arr, object value ) : void
arr _Array
value object
리턴 void

DeleteWCharArrayRaw() 공개 정적인 메소드

public static DeleteWCharArrayRaw ( _Array arr ) : object
arr _Array
리턴 object

DeleteWCharArrayValue() 공개 정적인 메소드

public static DeleteWCharArrayValue ( _Array arr ) : object
arr _Array
리턴 object

FormatError() 공개 정적인 메소드

public static FormatError ( ) : string
리턴 string

FormatError() 공개 정적인 메소드

public static FormatError ( int errorCode ) : string
errorCode int
리턴 string

FreeLibrary() 공개 정적인 메소드

public static FreeLibrary ( BigInteger handle ) : void
handle Microsoft.Scripting.Math.BigInteger
리턴 void

FreeLibrary() 공개 정적인 메소드

public static FreeLibrary ( IntPtr handle ) : void
handle System.IntPtr
리턴 void

FreeLibrary() 공개 정적인 메소드

public static FreeLibrary ( int handle ) : void
handle int
리턴 void

GetCharArrayValue() 공개 정적인 메소드

public static GetCharArrayValue ( _Array arr ) : object
arr _Array
리턴 object

GetWCharArrayRaw() 공개 정적인 메소드

public static GetWCharArrayRaw ( _Array arr ) : object
arr _Array
리턴 object

GetWCharArrayValue() 공개 정적인 메소드

public static GetWCharArrayValue ( _Array arr ) : object
arr _Array
리턴 object

LoadLibrary() 공개 정적인 메소드

public static LoadLibrary ( string library, [ mode ) : object
library string
mode [
리턴 object

POINTER() 공개 정적인 메소드

Returns a new type which represents a pointer given the existing type.
public static POINTER ( CodeContext context, IronPython.Runtime.Types.PythonType type ) : IronPython.Runtime.Types.PythonType
context CodeContext
type IronPython.Runtime.Types.PythonType
리턴 IronPython.Runtime.Types.PythonType

POINTER() 공개 정적인 메소드

public static POINTER ( CodeContext context, [ name ) : IronPython.Runtime.Types.PythonType
context CodeContext
name [
리턴 IronPython.Runtime.Types.PythonType

PyObj_FromPtr() 공개 정적인 메소드

Converts an address acquired from PyObj_FromPtr or that has been marshaled as type 'O' back into an object.
public static PyObj_FromPtr ( IntPtr address ) : object
address System.IntPtr
리턴 object

PyObj_ToPtr() 공개 정적인 메소드

Converts an object into an opaque address which can be handed out to managed code.
public static PyObj_ToPtr ( object obj ) : IntPtr
obj object
리턴 System.IntPtr

Py_DECREF() 공개 정적인 메소드

Decreases the ref count on an object which has been increased with Py_INCREF.
public static Py_DECREF ( object key ) : void
key object
리턴 void

Py_INCREF() 공개 정적인 메소드

Increases the ref count on an object ensuring that it will not be collected.
public static Py_INCREF ( object key ) : void
key object
리턴 void

SetCharArrayValue() 공개 정적인 메소드

public static SetCharArrayValue ( _Array arr, object value ) : void
arr _Array
value object
리턴 void

SetWCharArrayRaw() 공개 정적인 메소드

public static SetWCharArrayRaw ( _Array arr, object value ) : void
arr _Array
value object
리턴 void

SetWCharArrayValue() 공개 정적인 메소드

public static SetWCharArrayValue ( _Array arr, object value ) : void
arr _Array
value object
리턴 void

_buffer_info() 공개 정적인 메소드

public static _buffer_info ( CData data ) : PythonTuple
data CData
리턴 PythonTuple

_check_HRESULT() 공개 정적인 메소드

public static _check_HRESULT ( int hresult ) : void
hresult int
리턴 void

_unpickle() 공개 정적인 메소드

public static _unpickle ( ) : void
리턴 void

addressof() 공개 정적인 메소드

returns address of C instance internal buffer. It is the callers responsibility to ensure that the provided instance will stay alive if memory in the resulting address is to be used later.
public static addressof ( CData data ) : object
data CData
리턴 object

alignment() 공개 정적인 메소드

Gets the required alignment of the given type.
public static alignment ( IronPython.Runtime.Types.PythonType type ) : int
type IronPython.Runtime.Types.PythonType
리턴 int

alignment() 공개 정적인 메소드

Gets the required alignment of an object.
public static alignment ( object o ) : int
o object
리턴 int

byref() 공개 정적인 메소드

public static byref ( CData instance, [ offset ) : object
instance CData
offset [
리턴 object

call_cdeclfunction() 공개 정적인 메소드

public static call_cdeclfunction ( CodeContext context, BigInteger address, PythonTuple args ) : object
context CodeContext
address Microsoft.Scripting.Math.BigInteger
args PythonTuple
리턴 object

call_cdeclfunction() 공개 정적인 메소드

public static call_cdeclfunction ( CodeContext context, IntPtr address, PythonTuple args ) : object
context CodeContext
address System.IntPtr
args PythonTuple
리턴 object

call_cdeclfunction() 공개 정적인 메소드

public static call_cdeclfunction ( CodeContext context, int address, PythonTuple args ) : object
context CodeContext
address int
args PythonTuple
리턴 object

call_commethod() 공개 정적인 메소드

public static call_commethod ( ) : void
리턴 void

call_function() 공개 정적인 메소드

public static call_function ( CodeContext context, BigInteger address, PythonTuple args ) : object
context CodeContext
address Microsoft.Scripting.Math.BigInteger
args PythonTuple
리턴 object

call_function() 공개 정적인 메소드

public static call_function ( CodeContext context, IntPtr address, PythonTuple args ) : object
context CodeContext
address System.IntPtr
args PythonTuple
리턴 object

call_function() 공개 정적인 메소드

public static call_function ( CodeContext context, int address, PythonTuple args ) : object
context CodeContext
address int
args PythonTuple
리턴 object

dlopen() 공개 정적인 메소드

public static dlopen ( string library, [ mode ) : object
library string
mode [
리턴 object

get_errno() 공개 정적인 메소드

public static get_errno ( ) : int
리턴 int

get_last_error() 공개 정적인 메소드

public static get_last_error ( ) : int
리턴 int

pointer() 공개 정적인 메소드

Returns a pointer instance for the given CData
public static pointer ( CodeContext context, CData data ) : Pointer
context CodeContext
data CData
리턴 System.Reflection.Pointer

resize() 공개 정적인 메소드

public static resize ( CData obj, int newSize ) : void
obj CData
newSize int
리턴 void

set_conversion_mode() 공개 정적인 메소드

public static set_conversion_mode ( CodeContext context, string encoding, string errors ) : PythonTuple
context CodeContext
encoding string
errors string
리턴 PythonTuple

set_errno() 공개 정적인 메소드

public static set_errno ( ) : void
리턴 void

set_last_error() 공개 정적인 메소드

public static set_last_error ( int errorCode ) : void
errorCode int
리턴 void