You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2015/08/17 22:26:01 UTC
[3/6] lucy-clownfish git commit: Add Go binding for Obj_get_class.
Add Go binding for Obj_get_class.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/e2152ee5
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/e2152ee5
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/e2152ee5
Branch: refs/heads/master
Commit: e2152ee531a5b7cfbaad33b12a138e91851cf7ec
Parents: d28ce6e
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Aug 11 12:43:39 2015 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Fri Aug 14 15:36:17 2015 -0700
----------------------------------------------------------------------
runtime/go/clownfish/clownfish.go | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/e2152ee5/runtime/go/clownfish/clownfish.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/clownfish.go b/runtime/go/clownfish/clownfish.go
index 1d0f40c..6fa8919 100644
--- a/runtime/go/clownfish/clownfish.go
+++ b/runtime/go/clownfish/clownfish.go
@@ -123,6 +123,12 @@ type ObjIMP struct {
ref uintptr
}
+func GetClass(o Obj) Class {
+ objCF := (*C.cfish_Obj)(unsafe.Pointer(o.TOPTR()))
+ classCF := C.cfish_Obj_get_class(objCF)
+ return WRAPClass(unsafe.Pointer(classCF))
+}
+
func FetchClass(className string) Class {
nameCF := (*C.cfish_String)(GoToString(className))
defer C.cfish_decref(unsafe.Pointer(nameCF))