本文整理匯總了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)
})
}
示例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))
})
}
示例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)
})
}
示例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))
})
}
示例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)
})
}
示例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))
})
}
示例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)
})
}
示例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)
})
}
示例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")))
}
示例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)
})
}
示例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)
})
}
示例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)
})
}
示例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))
}
示例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
}
示例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
}