Documentation
¶
Overview ¶
Package gopyh provides the variable gopyvar manager for gopy. The gopyvars map can NOT be globally shared in C because it must use interface{} values that can change location via GC. In effect, each gopy package must be thought of as a completely separate Go instance, and there can be NO sharing of anything between them, because they fundamentally live in different .so libraries. Thus, we must ensure that all gopyvars used within a package are registered within that same package -- this means python users typically will import a single package, which exports all the relevant functionality as needed. Any further packages cannot share anything other than basic types (int, string etc).
Index ¶
- func DecRef(gopyvar CGoGopyvar)
- func Embed(stru interface{}, embed reflect.Type) interface{}
- func IfaceIsNil(it interface{}) bool
- func IncRef(gopyvar CGoGopyvar)
- func NonPtrValue(v reflect.Value) reflect.Value
- func NumGopyvars() int
- func PtrValue(v reflect.Value) reflect.Value
- func VarFromGopyvar(h CGoGopyvar, typnm string) interface{}
- func VarFromGopyvarTry(h CGoGopyvar, typnm string) (interface{}, error)
- type CGoGopyvar
- type GoGopyvar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecRef ¶
func DecRef(gopyvar CGoGopyvar)
DecRef decrements the reference count for the specified gopyvar and removes it if the reference count goes to zero.
func Embed ¶
Embed returns the embedded struct (in first field only) of given type within given struct
func IfaceIsNil ¶
func IfaceIsNil(it interface{}) bool
IfaceIsNil returns true if interface or value represented by interface is nil
func IncRef ¶
func IncRef(gopyvar CGoGopyvar)
IncRef increments the reference count for the specified gopyvar.
func NonPtrValue ¶
NonPtrValue returns the non-pointer underlying value
func PtrValue ¶
PtrValue returns the pointer version (Addr()) of the underlying value if the value is not already a Ptr
func VarFromGopyvar ¶
func VarFromGopyvar(h CGoGopyvar, typnm string) interface{}
VarFromGopyvar gets variable from gopyvar string. Reports error to python but does not return it, for use in inline calls
func VarFromGopyvarTry ¶
func VarFromGopyvarTry(h CGoGopyvar, typnm string) (interface{}, error)
VarFromGopyvarTry version returns the error explicitly, for use when error can be processed
Types ¶
type CGoGopyvar ¶
type CGoGopyvar int64
func Register ¶
func Register(typnm string, ifc interface{}) CGoGopyvar
Register registers a new variable instance.