當前位置: 首頁>>代碼示例>>Golang>>正文


Golang clownfish.Unwrap函數代碼示例

本文整理匯總了Golang中git-wip-us/apache/org/repos/asf/lucy-clownfish/git/runtime/go/clownfish.Unwrap函數的典型用法代碼示例。如果您正苦於以下問題:Golang Unwrap函數的具體用法?Golang Unwrap怎麽用?Golang Unwrap使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Unwrap函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: readRecord

func (s *StepperIMP) readRecord(instream InStream) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_Stepper)(clownfish.Unwrap(s, "s"))
		instreamCF := (*C.lucy_InStream)(clownfish.Unwrap(instream, "instream"))
		C.LUCY_Stepper_Read_Record(self, instreamCF)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:util.go

示例2: addInvertedDoc

func (d *DataWriterIMP) addInvertedDoc(inverter Inverter, docId int32) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_DataWriter)(clownfish.Unwrap(d, "d"))
		inverterCF := (*C.lucy_Inverter)(clownfish.Unwrap(inverter, "inverter"))
		C.LUCY_DataWriter_Add_Inverted_Doc(self, inverterCF, C.int32_t(docId))
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:index.go

示例3: DeleteByQuery

func (d *DeletionsWriterIMP) DeleteByQuery(query Query) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_DeletionsWriter)(clownfish.Unwrap(d, "d"))
		queryCF := (*C.lucy_Query)(clownfish.Unwrap(query, "query"))
		C.LUCY_DelWriter_Delete_By_Query(self, queryCF)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:index.go

示例4: AddDoc

func (s *SegWriterIMP) AddDoc(doc Doc, boost float32) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_SegWriter)(clownfish.Unwrap(s, "s"))
		docCF := (*C.lucy_Doc)(clownfish.Unwrap(doc, "doc"))
		C.LUCY_SegWriter_Add_Doc(self, docCF, C.float(boost))
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:index.go

示例5: ReadFile

func (s *SegmentIMP) ReadFile(folder Folder) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_Segment)(clownfish.Unwrap(s, "s"))
		folderC := (*C.lucy_Folder)(clownfish.Unwrap(folder, "folder"))
		C.LUCY_Seg_Read_File(self, folderC)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:index.go

示例6: addDocObj

func (obj *IndexerIMP) addDocObj(doc Doc, boost float32) error {
	self := (*C.lucy_Indexer)(clownfish.Unwrap(obj, "obj"))
	d := (*C.lucy_Doc)(clownfish.Unwrap(doc, "doc"))
	return clownfish.TrapErr(func() {
		C.LUCY_Indexer_Add_Doc(self, d, C.float(boost))
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:index.go

示例7: Absorb

func (out *OutStreamIMP) Absorb(in InStream) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_OutStream)(clownfish.Unwrap(out, "out"))
		inStreamC := (*C.lucy_InStream)(clownfish.Unwrap(in, "in"))
		C.LUCY_OutStream_Absorb(self, inStreamC)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:store.go

示例8: DeleteSegment

func (d *DataWriterIMP) DeleteSegment(reader SegReader) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_DataWriter)(clownfish.Unwrap(d, "d"))
		readerCF := (*C.lucy_SegReader)(clownfish.Unwrap(reader, "reader"))
		C.LUCY_DataWriter_Delete_Segment(self, readerCF)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:7,代碼來源:index.go

示例9: SetMatchDocs

func (td *TopDocsIMP) SetMatchDocs(matchDocs []MatchDoc) {
	self := (*C.lucy_TopDocs)(clownfish.Unwrap(td, "td"))
	vec := clownfish.NewVector(len(matchDocs))
	for _, matchDoc := range matchDocs {
		vec.Push(matchDoc)
	}
	C.LUCY_TopDocs_Set_Match_Docs(self, (*C.cfish_Vector)(clownfish.Unwrap(vec, "matchDocs")))
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:8,代碼來源:search.go

示例10: WriteDelta

func (s *StepperIMP) WriteDelta(outstream OutStream, value interface{}) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_Stepper)(clownfish.Unwrap(s, "s"))
		outstreamCF := (*C.lucy_OutStream)(clownfish.Unwrap(outstream, "outstream"))
		valueCF := (*C.cfish_Obj)(clownfish.GoToClownfish(value, unsafe.Pointer(C.CFISH_OBJ), false))
		defer C.cfish_decref(unsafe.Pointer(valueCF))
		C.LUCY_Stepper_Write_Delta(self, outstreamCF, valueCF)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:9,代碼來源:util.go

示例11: WriteFile

func (s *SnapshotIMP) WriteFile(folder Folder, path string) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_Snapshot)(clownfish.Unwrap(s, "s"))
		folderC := (*C.lucy_Folder)(clownfish.Unwrap(folder, "folder"))
		pathC := (*C.cfish_String)(clownfish.GoToClownfish(path, unsafe.Pointer(C.CFISH_STRING), false))
		defer C.cfish_decref(unsafe.Pointer(pathC))
		C.LUCY_Snapshot_Write_File(self, folderC, pathC)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:9,代碼來源:index.go

示例12: MergeSegment

func (d *DataWriterIMP) MergeSegment(reader SegReader, docMap []int32) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_DataWriter)(clownfish.Unwrap(d, "d"))
		readerCF := (*C.lucy_SegReader)(clownfish.Unwrap(reader, "reader"))
		docMapConv := NewI32Array(docMap)
		docMapCF := (*C.lucy_I32Array)(clownfish.UnwrapNullable(docMapConv))
		C.LUCY_DataWriter_Merge_Segment(self, readerCF, docMapCF)
	})
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:9,代碼來源:index.go

示例13: NewSeriesMatcher

func NewSeriesMatcher(matchers []Matcher, offsets []int32) SeriesMatcher {
	vec := clownfish.NewVector(len(matchers))
	for _, child := range matchers {
		vec.Push(child)
	}
	i32arr := NewI32Array(offsets)
	cfObj := C.lucy_SeriesMatcher_new(((*C.cfish_Vector)(clownfish.Unwrap(vec, "matchers"))),
		((*C.lucy_I32Array)(clownfish.Unwrap(i32arr, "offsets"))))
	return WRAPSeriesMatcher(unsafe.Pointer(cfObj))
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:10,代碼來源:search.go

示例14: generateDocMap

func (d *DeletionsWriterIMP) generateDocMap(deletions Matcher, docMax int32, offset int32) (retval []int32, err error) {
	err = clownfish.TrapErr(func() {
		self := (*C.lucy_DeletionsWriter)(clownfish.Unwrap(d, "d"))
		deletionsCF := (*C.lucy_Matcher)(clownfish.Unwrap(deletions, "deletions"))
		retvalCF := C.LUCY_DelWriter_Generate_Doc_Map(self, deletionsCF, C.int32_t(docMax), C.int32_t(offset))
		defer C.cfish_decref(unsafe.Pointer(retvalCF))
		retval = i32ArrayToSlice(retvalCF)
	})
	return retval, err
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:10,代碼來源:index.go

示例15: Window

func (fh *FileHandleIMP) Window(window FileWindow, offset, length int64) error {
	self := (*C.lucy_FileHandle)(clownfish.Unwrap(fh, "fh"))
	windowC := (*C.lucy_FileWindow)(clownfish.Unwrap(window, "window"))
	success := C.LUCY_FH_Window(self, windowC, C.int64_t(offset), C.int64_t(length))
	if !success {
		cfErr := C.cfish_Err_get_error()
		return clownfish.WRAPAny(unsafe.Pointer(C.cfish_incref(unsafe.Pointer(cfErr)))).(error)
	}
	return nil
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:10,代碼來源:store.go


注:本文中的git-wip-us/apache/org/repos/asf/lucy-clownfish/git/runtime/go/clownfish.Unwrap函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。