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


Golang C.lucy_Doc_IVARS函數代碼示例

本文整理匯總了Golang中C.lucy_Doc_IVARS函數的典型用法代碼示例。如果您正苦於以下問題:Golang lucy_Doc_IVARS函數的具體用法?Golang lucy_Doc_IVARS怎麽用?Golang lucy_Doc_IVARS使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: GOLUCY_Doc_Equals

//export GOLUCY_Doc_Equals
func GOLUCY_Doc_Equals(d *C.lucy_Doc, other *C.cfish_Obj) C.bool {
	twin := (*C.lucy_Doc)(unsafe.Pointer(other))
	if twin == d {
		return true
	}
	if !C.cfish_Obj_is_a(other, C.LUCY_DOC) {
		return false
	}
	ivars := C.lucy_Doc_IVARS(d)
	ovars := C.lucy_Doc_IVARS(twin)
	hash := (*C.cfish_Hash)(ivars.fields)
	otherHash := (*C.cfish_Obj)(ovars.fields)
	return C.CFISH_Hash_Equals(hash, otherHash)
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:15,代碼來源:lucy.go

示例2: GOLUCY_Doc_Serialize

//export GOLUCY_Doc_Serialize
func GOLUCY_Doc_Serialize(d *C.lucy_Doc, outstream *C.lucy_OutStream) {
	ivars := C.lucy_Doc_IVARS(d)
	fields := fetchDocFields(d)
	hash := clownfish.GoToClownfish(fields, unsafe.Pointer(C.CFISH_HASH), false)
	defer C.cfish_decref(hash)
	C.lucy_Freezer_serialize_hash((*C.cfish_Hash)(hash), outstream)
	C.LUCY_OutStream_Write_C32(outstream, C.uint32_t(ivars.doc_id))
}
開發者ID:lazycrazyowl,項目名稱:lucy,代碼行數:9,代碼來源:lucy.go

示例3: SetFields

func (d *DocIMP) SetFields(fields map[string]interface{}) {
	self := (*C.lucy_Doc)(clownfish.Unwrap(d, "d"))
	ivars := C.lucy_Doc_IVARS(self)
	oldID := uintptr(unsafe.Pointer(ivars.fields))
	newFieldsID := registry.store(fields)
	ivars.fields = unsafe.Pointer(newFieldsID)
	registry.delete(oldID)
}
開發者ID:rlugojr,項目名稱:lucy,代碼行數:8,代碼來源:document.go

示例4: fetchDocFields

func fetchDocFields(d *C.lucy_Doc) map[string]interface{} {
	ivars := C.lucy_Doc_IVARS(d)
	fieldsID := uintptr(ivars.fields)
	fieldsGo, ok := registry.fetch(fieldsID).(map[string]interface{})
	if !ok {
		panic(clownfish.NewErr(fmt.Sprintf("Failed to fetch doc %d from registry ", fieldsID)))
	}
	return fieldsGo
}
開發者ID:lazycrazyowl,項目名稱:lucy,代碼行數:9,代碼來源:document.go

示例5: GOLUCY_Doc_Deserialize

//export GOLUCY_Doc_Deserialize
func GOLUCY_Doc_Deserialize(d *C.lucy_Doc, instream *C.lucy_InStream) *C.lucy_Doc {
	ivars := C.lucy_Doc_IVARS(d)
	hash := unsafe.Pointer(C.lucy_Freezer_read_hash(instream))
	defer C.cfish_decref(hash)
	fields := clownfish.ToGo(hash)
	fieldsID := registry.store(fields)
	ivars.fields = unsafe.Pointer(fieldsID)
	ivars.doc_id = C.int32_t(C.LUCY_InStream_Read_C32(instream))
	return d
}
開發者ID:lazycrazyowl,項目名稱:lucy,代碼行數:11,代碼來源:lucy.go

示例6: GOLUCY_Doc_init

//export GOLUCY_Doc_init
func GOLUCY_Doc_init(d *C.lucy_Doc, fields unsafe.Pointer, docID C.int32_t) *C.lucy_Doc {
	ivars := C.lucy_Doc_IVARS(d)
	if fields != nil {
		ivars.fields = unsafe.Pointer(C.cfish_inc_refcount(fields))
	} else {
		ivars.fields = unsafe.Pointer(C.cfish_Hash_new(0))
	}
	ivars.doc_id = docID
	return d
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:11,代碼來源:lucy.go

示例7: GOLUCY_Doc_init

//export GOLUCY_Doc_init
func GOLUCY_Doc_init(d *C.lucy_Doc, fields unsafe.Pointer, docID C.int32_t) *C.lucy_Doc {
	ivars := C.lucy_Doc_IVARS(d)
	if fields == nil {
		fieldsGo := make(map[string]interface{})
		fieldsID := registry.store(fieldsGo)
		ivars.fields = unsafe.Pointer(fieldsID)
	} else {
		ivars.fields = fields
	}
	ivars.doc_id = docID
	return d
}
開發者ID:lazycrazyowl,項目名稱:lucy,代碼行數:13,代碼來源:lucy.go

示例8: GOLUCY_Doc_Destroy

//export GOLUCY_Doc_Destroy
func GOLUCY_Doc_Destroy(d *C.lucy_Doc) {
	ivars := C.lucy_Doc_IVARS(d)
	fieldsID := uintptr(ivars.fields)
	registry.delete(fieldsID)
	C.cfish_super_destroy(unsafe.Pointer(d), C.LUCY_DOC)
}
開發者ID:lazycrazyowl,項目名稱:lucy,代碼行數:7,代碼來源:lucy.go

示例9: GOLUCY_Doc_Destroy

//export GOLUCY_Doc_Destroy
func GOLUCY_Doc_Destroy(d *C.lucy_Doc) {
	ivars := C.lucy_Doc_IVARS(d)
	C.cfish_decref(unsafe.Pointer(ivars.fields))
	C.cfish_super_destroy(unsafe.Pointer(d), C.LUCY_DOC)
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:6,代碼來源:lucy.go

示例10: GOLUCY_Doc_Field_Names

//export GOLUCY_Doc_Field_Names
func GOLUCY_Doc_Field_Names(d *C.lucy_Doc) *C.cfish_Vector {
	ivars := C.lucy_Doc_IVARS(d)
	hash := (*C.cfish_Hash)(ivars.fields)
	return C.CFISH_Hash_Keys(hash)
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:6,代碼來源:lucy.go

示例11: GOLUCY_Doc_Extract

//export GOLUCY_Doc_Extract
func GOLUCY_Doc_Extract(d *C.lucy_Doc, field *C.cfish_String) *C.cfish_Obj {
	ivars := C.lucy_Doc_IVARS(d)
	hash := (*C.cfish_Hash)(ivars.fields)
	val := C.CFISH_Hash_Fetch(hash, field)
	return C.cfish_inc_refcount(unsafe.Pointer(val))
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:7,代碼來源:lucy.go

示例12: GOLUCY_Doc_Deserialize

//export GOLUCY_Doc_Deserialize
func GOLUCY_Doc_Deserialize(d *C.lucy_Doc, instream *C.lucy_InStream) *C.lucy_Doc {
	ivars := C.lucy_Doc_IVARS(d)
	ivars.fields = unsafe.Pointer(C.lucy_Freezer_read_hash(instream))
	ivars.doc_id = C.int32_t(C.LUCY_InStream_Read_C32(instream))
	return d
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:7,代碼來源:lucy.go

示例13: GOLUCY_Doc_Serialize

//export GOLUCY_Doc_Serialize
func GOLUCY_Doc_Serialize(d *C.lucy_Doc, outstream *C.lucy_OutStream) {
	ivars := C.lucy_Doc_IVARS(d)
	hash := (*C.cfish_Hash)(ivars.fields)
	C.lucy_Freezer_serialize_hash(hash, outstream)
	C.LUCY_OutStream_Write_C32(outstream, C.uint32_t(ivars.doc_id))
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:7,代碼來源:lucy.go

示例14: GOLUCY_Doc_Store

//export GOLUCY_Doc_Store
func GOLUCY_Doc_Store(d *C.lucy_Doc, field *C.cfish_String, value *C.cfish_Obj) {
	ivars := C.lucy_Doc_IVARS(d)
	hash := (*C.cfish_Hash)(ivars.fields)
	C.CFISH_Hash_Store(hash, field, C.cfish_inc_refcount(unsafe.Pointer(value)))
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:6,代碼來源:lucy.go

示例15: GOLUCY_Doc_Get_Size

//export GOLUCY_Doc_Get_Size
func GOLUCY_Doc_Get_Size(d *C.lucy_Doc) C.uint32_t {
	ivars := C.lucy_Doc_IVARS(d)
	hash := ((*C.cfish_Hash)(ivars.fields))
	return C.uint32_t(C.CFISH_Hash_Get_Size(hash))
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:6,代碼來源:lucy.go


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