当前位置: 首页>>代码示例>>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;未经允许,请勿转载。