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/10 03:59:11 UTC

[10/17] lucy-clownfish git commit: Customize HashIterator Go ctor binding.

Customize HashIterator Go ctor binding.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/a9ea5430
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/a9ea5430
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/a9ea5430

Branch: refs/heads/master
Commit: a9ea5430b823bd626ce7b1f64f7d4f92addd9511
Parents: 85743e3
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Aug 5 17:15:26 2015 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 6 19:51:32 2015 -0700

----------------------------------------------------------------------
 runtime/go/build.go               | 4 ++++
 runtime/go/clownfish/clownfish.go | 6 ++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a9ea5430/runtime/go/build.go
----------------------------------------------------------------------
diff --git a/runtime/go/build.go b/runtime/go/build.go
index dd6b1f3..29f02ba 100644
--- a/runtime/go/build.go
+++ b/runtime/go/build.go
@@ -158,6 +158,10 @@ func specMethods(parcel *cfc.Parcel) {
 	hashBinding.SpecMethod("Keys", "Keys() []string")
 	hashBinding.SetSuppressCtor(true)
 	hashBinding.Register()
+
+	hashIterBinding := cfc.NewGoClass(parcel, "Clownfish::HashIterator")
+	hashIterBinding.SetSuppressCtor(true)
+	hashIterBinding.Register()
 }
 
 func prep() {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a9ea5430/runtime/go/clownfish/clownfish.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/clownfish.go b/runtime/go/clownfish/clownfish.go
index 4da8c82..3087cc0 100644
--- a/runtime/go/clownfish/clownfish.go
+++ b/runtime/go/clownfish/clownfish.go
@@ -146,6 +146,12 @@ func NewHash(size int) Hash {
 	return WRAPHash(unsafe.Pointer(cfObj))
 }
 
+func NewHashIterator(hash Hash) HashIterator {
+	hashCF := (*C.cfish_Hash)(unsafe.Pointer(hash.TOPTR()))
+	cfObj := C.cfish_HashIter_new(hashCF)
+	return WRAPHashIterator(unsafe.Pointer(cfObj))
+}
+
 func (h *HashIMP) Keys() []string {
 	self := (*C.cfish_Hash)(unsafe.Pointer(h.TOPTR()))
 	keysCF := C.CFISH_Hash_Keys(self)