5
|
|
|
|
|
|
|
/*
* ***********************************************
*
* !!!! DO NOT EDIT !!!!
*
* This file was auto-generated by Build.PL.
*
* ***********************************************
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef H_LUCY_INDEX_INDEXER
#define H_LUCY_INDEX_INDEXER 1
#ifdef __cplusplus
extern "C" {
#endif
#include "lucy_parcel.h"
/* Include the header for this class's parent.
*/
#include "Clownfish/Obj.h"
/* Define the struct layout for instances of this class.
*/
#ifdef C_LUCY_INDEXER
extern uint32_t lucy_Indexer_IVARS_OFFSET;
typedef struct lucy_IndexerIVARS lucy_IndexerIVARS;
static CFISH_INLINE lucy_IndexerIVARS*
lucy_Indexer_IVARS(lucy_Indexer *self) {
char *ptr = (char*)self + lucy_Indexer_IVARS_OFFSET;
return (lucy_IndexerIVARS*)ptr;
}
#ifdef LUCY_USE_SHORT_NAMES
#define IndexerIVARS lucy_IndexerIVARS
#define Indexer_IVARS lucy_Indexer_IVARS
#endif
struct lucy_IndexerIVARS {
lucy_Schema* schema;
lucy_Folder* folder;
lucy_Segment* segment;
lucy_IndexManager* manager;
lucy_PolyReader* polyreader;
lucy_Snapshot* snapshot;
lucy_SegWriter* seg_writer;
lucy_DeletionsWriter* del_writer;
lucy_FilePurger* file_purger;
lucy_Lock* write_lock;
lucy_Lock* merge_lock;
lucy_Doc* stock_doc;
cfish_String* snapfile;
bool truncate;
bool optimize;
bool needs_commit;
bool prepared;
};
#endif /* C_LUCY_INDEXER */
/* Declare this class's inert variables.
*/
extern LUCY_VISIBLE int32_t lucy_Indexer_TRUNCATE;
extern LUCY_VISIBLE int32_t lucy_Indexer_CREATE;
/* Declare both this class's inert functions and the C functions which
* implement this class's dynamic methods.
*/
LUCY_VISIBLE lucy_Indexer*
lucy_Indexer_new(lucy_Schema* schema, cfish_Obj* index, lucy_IndexManager* manager, int32_t flags);
LUCY_VISIBLE lucy_Indexer*
lucy_Indexer_init(lucy_Indexer* self, lucy_Schema* schema, cfish_Obj* index, lucy_IndexManager* manager, int32_t flags);
void
LUCY_Indexer_Add_Doc_IMP(lucy_Indexer* self, lucy_Doc* doc, float boost);
void
LUCY_Indexer_Add_Index_IMP(lucy_Indexer* self, cfish_Obj* index);
void
LUCY_Indexer_Delete_By_Term_IMP(lucy_Indexer* self, cfish_String* field, cfish_Obj* term);
void
LUCY_Indexer_Delete_By_Query_IMP(lucy_Indexer* self, lucy_Query* query);
void
LUCY_Indexer_Delete_By_Doc_ID_IMP(lucy_Indexer* self, int32_t doc_id);
void
LUCY_Indexer_Optimize_IMP(lucy_Indexer* self);
void
LUCY_Indexer_Commit_IMP(lucy_Indexer* self);
void
LUCY_Indexer_Prepare_Commit_IMP(lucy_Indexer* self);
lucy_Schema*
LUCY_Indexer_Get_Schema_IMP(lucy_Indexer* self);
lucy_SegWriter*
LUCY_Indexer_Get_Seg_Writer_IMP(lucy_Indexer* self);
lucy_Doc*
LUCY_Indexer_Get_Stock_Doc_IMP(lucy_Indexer* self);
void
LUCY_Indexer_Destroy_IMP(lucy_Indexer* self);
/* Define typedefs for each dynamic method, allowing us to cast generic
* pointers to the appropriate function pointer type more cleanly.
*/
typedef void*
(*LUCY_Indexer_To_Host_t)(lucy_Indexer* self, void* vcache);
typedef cfish_Obj*
(*LUCY_Indexer_Clone_t)(lucy_Indexer* self);
typedef bool
(*LUCY_Indexer_Equals_t)(lucy_Indexer* self, cfish_Obj* other);
typedef int32_t
(*LUCY_Indexer_Compare_To_t)(lucy_Indexer* self, cfish_Obj* other);
typedef void
(*LUCY_Indexer_Destroy_t)(lucy_Indexer* self);
typedef cfish_String*
(*LUCY_Indexer_To_String_t)(lucy_Indexer* self);
typedef void
(*LUCY_Indexer_Add_Doc_t)(lucy_Indexer* self, lucy_Doc* doc, float boost);
typedef void
(*LUCY_Indexer_Add_Index_t)(lucy_Indexer* self, cfish_Obj* index);
typedef void
(*LUCY_Indexer_Delete_By_Term_t)(lucy_Indexer* self, cfish_String* field, cfish_Obj* term);
typedef void
(*LUCY_Indexer_Delete_By_Query_t)(lucy_Indexer* self, lucy_Query* query);
typedef void
(*LUCY_Indexer_Delete_By_Doc_ID_t)(lucy_Indexer* self, int32_t doc_id);
typedef void
(*LUCY_Indexer_Optimize_t)(lucy_Indexer* self);
typedef void
(*LUCY_Indexer_Commit_t)(lucy_Indexer* self);
typedef void
(*LUCY_Indexer_Prepare_Commit_t)(lucy_Indexer* self);
typedef lucy_Schema*
(*LUCY_Indexer_Get_Schema_t)(lucy_Indexer* self);
typedef lucy_SegWriter*
(*LUCY_Indexer_Get_Seg_Writer_t)(lucy_Indexer* self);
typedef lucy_Doc*
(*LUCY_Indexer_Get_Stock_Doc_t)(lucy_Indexer* self);
/* Define type-safe wrappers for inert functions of Obj.
*/
static CFISH_INLINE cfish_Class*
lucy_Indexer_get_class(lucy_Indexer *self) {
return cfish_Obj_get_class((cfish_Obj*)self);
}
static CFISH_INLINE cfish_String*
lucy_Indexer_get_class_name(lucy_Indexer *self) {
return cfish_Obj_get_class_name((cfish_Obj*)self);
}
static CFISH_INLINE bool
lucy_Indexer_is_a(lucy_Indexer *self, cfish_Class *ancestor) {
return cfish_Obj_is_a((cfish_Obj*)self, ancestor);
}
/* Define the inline functions which implement this class's virtual methods.
*/
extern LUCY_VISIBLE uint32_t LUCY_Indexer_To_Host_OFFSET;
static CFISH_INLINE void*
LUCY_Indexer_To_Host(lucy_Indexer* self, void* vcache) {
const LUCY_Indexer_To_Host_t method = (LUCY_Indexer_To_Host_t)cfish_obj_method(self, LUCY_Indexer_To_Host_OFFSET);
return method(self, vcache);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Clone_OFFSET;
static CFISH_INLINE cfish_Obj*
LUCY_Indexer_Clone(lucy_Indexer* self) {
const LUCY_Indexer_Clone_t method = (LUCY_Indexer_Clone_t)cfish_obj_method(self, LUCY_Indexer_Clone_OFFSET);
return method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Equals_OFFSET;
static CFISH_INLINE bool
LUCY_Indexer_Equals(lucy_Indexer* self, cfish_Obj* other) {
const LUCY_Indexer_Equals_t method = (LUCY_Indexer_Equals_t)cfish_obj_method(self, LUCY_Indexer_Equals_OFFSET);
return method(self, other);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Compare_To_OFFSET;
static CFISH_INLINE int32_t
LUCY_Indexer_Compare_To(lucy_Indexer* self, cfish_Obj* other) {
const LUCY_Indexer_Compare_To_t method = (LUCY_Indexer_Compare_To_t)cfish_obj_method(self, LUCY_Indexer_Compare_To_OFFSET);
return method(self, other);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Destroy_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Destroy(lucy_Indexer* self) {
const LUCY_Indexer_Destroy_t method = (LUCY_Indexer_Destroy_t)cfish_obj_method(self, LUCY_Indexer_Destroy_OFFSET);
method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_To_String_OFFSET;
static CFISH_INLINE cfish_String*
LUCY_Indexer_To_String(lucy_Indexer* self) {
const LUCY_Indexer_To_String_t method = (LUCY_Indexer_To_String_t)cfish_obj_method(self, LUCY_Indexer_To_String_OFFSET);
return method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Add_Doc_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Add_Doc(lucy_Indexer* self, lucy_Doc* doc, float boost) {
const LUCY_Indexer_Add_Doc_t method = (LUCY_Indexer_Add_Doc_t)cfish_obj_method(self, LUCY_Indexer_Add_Doc_OFFSET);
method(self, doc, boost);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Add_Index_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Add_Index(lucy_Indexer* self, cfish_Obj* index) {
const LUCY_Indexer_Add_Index_t method = (LUCY_Indexer_Add_Index_t)cfish_obj_method(self, LUCY_Indexer_Add_Index_OFFSET);
method(self, index);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Delete_By_Term_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Delete_By_Term(lucy_Indexer* self, cfish_String* field, cfish_Obj* term) {
const LUCY_Indexer_Delete_By_Term_t method = (LUCY_Indexer_Delete_By_Term_t)cfish_obj_method(self, LUCY_Indexer_Delete_By_Term_OFFSET);
method(self, field, term);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Delete_By_Query_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Delete_By_Query(lucy_Indexer* self, lucy_Query* query) {
const LUCY_Indexer_Delete_By_Query_t method = (LUCY_Indexer_Delete_By_Query_t)cfish_obj_method(self, LUCY_Indexer_Delete_By_Query_OFFSET);
method(self, query);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Delete_By_Doc_ID_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Delete_By_Doc_ID(lucy_Indexer* self, int32_t doc_id) {
const LUCY_Indexer_Delete_By_Doc_ID_t method = (LUCY_Indexer_Delete_By_Doc_ID_t)cfish_obj_method(self, LUCY_Indexer_Delete_By_Doc_ID_OFFSET);
method(self, doc_id);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Optimize_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Optimize(lucy_Indexer* self) {
const LUCY_Indexer_Optimize_t method = (LUCY_Indexer_Optimize_t)cfish_obj_method(self, LUCY_Indexer_Optimize_OFFSET);
method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Commit_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Commit(lucy_Indexer* self) {
const LUCY_Indexer_Commit_t method = (LUCY_Indexer_Commit_t)cfish_obj_method(self, LUCY_Indexer_Commit_OFFSET);
method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Prepare_Commit_OFFSET;
static CFISH_INLINE void
LUCY_Indexer_Prepare_Commit(lucy_Indexer* self) {
const LUCY_Indexer_Prepare_Commit_t method = (LUCY_Indexer_Prepare_Commit_t)cfish_obj_method(self, LUCY_Indexer_Prepare_Commit_OFFSET);
method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Get_Schema_OFFSET;
static CFISH_INLINE lucy_Schema*
LUCY_Indexer_Get_Schema(lucy_Indexer* self) {
const LUCY_Indexer_Get_Schema_t method = (LUCY_Indexer_Get_Schema_t)cfish_obj_method(self, LUCY_Indexer_Get_Schema_OFFSET);
return method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Get_Seg_Writer_OFFSET;
static CFISH_INLINE lucy_SegWriter*
LUCY_Indexer_Get_Seg_Writer(lucy_Indexer* self) {
const LUCY_Indexer_Get_Seg_Writer_t method = (LUCY_Indexer_Get_Seg_Writer_t)cfish_obj_method(self, LUCY_Indexer_Get_Seg_Writer_OFFSET);
return method(self);
}
extern LUCY_VISIBLE uint32_t LUCY_Indexer_Get_Stock_Doc_OFFSET;
static CFISH_INLINE lucy_Doc*
LUCY_Indexer_Get_Stock_Doc(lucy_Indexer* self) {
const LUCY_Indexer_Get_Stock_Doc_t method = (LUCY_Indexer_Get_Stock_Doc_t)cfish_obj_method(self, LUCY_Indexer_Get_Stock_Doc_OFFSET);
return method(self);
}
/* Declare callbacks for wrapping host overrides.
*/
#ifdef CFISH_NO_DYNAMIC_OVERRIDES
#define Lucy_Indexer_Add_Doc_OVERRIDE NULL
#define Lucy_Indexer_Add_Index_OVERRIDE NULL
#define Lucy_Indexer_Delete_By_Term_OVERRIDE NULL
#define Lucy_Indexer_Delete_By_Query_OVERRIDE NULL
#define Lucy_Indexer_Delete_By_Doc_ID_OVERRIDE NULL
#define Lucy_Indexer_Optimize_OVERRIDE NULL
#define Lucy_Indexer_Commit_OVERRIDE NULL
#define Lucy_Indexer_Prepare_Commit_OVERRIDE NULL
#define Lucy_Indexer_Get_Schema_OVERRIDE NULL
#define Lucy_Indexer_Get_Seg_Writer_OVERRIDE NULL
#define Lucy_Indexer_Get_Stock_Doc_OVERRIDE NULL
#else
void
Lucy_Indexer_Add_Doc_OVERRIDE(lucy_Indexer* self, lucy_Doc* doc, float boost);
void
Lucy_Indexer_Add_Index_OVERRIDE(lucy_Indexer* self, cfish_Obj* index);
void
Lucy_Indexer_Delete_By_Term_OVERRIDE(lucy_Indexer* self, cfish_String* field, cfish_Obj* term);
void
Lucy_Indexer_Delete_By_Query_OVERRIDE(lucy_Indexer* self, lucy_Query* query);
void
Lucy_Indexer_Delete_By_Doc_ID_OVERRIDE(lucy_Indexer* self, int32_t doc_id);
void
Lucy_Indexer_Optimize_OVERRIDE(lucy_Indexer* self);
void
Lucy_Indexer_Commit_OVERRIDE(lucy_Indexer* self);
void
Lucy_Indexer_Prepare_Commit_OVERRIDE(lucy_Indexer* self);
lucy_Schema*
Lucy_Indexer_Get_Schema_OVERRIDE(lucy_Indexer* self);
lucy_SegWriter*
Lucy_Indexer_Get_Seg_Writer_OVERRIDE(lucy_Indexer* self);
lucy_Doc*
Lucy_Indexer_Get_Stock_Doc_OVERRIDE(lucy_Indexer* self);
#endif
/* Define "short names" for this class's symbols.
*/
#ifdef LUCY_USE_SHORT_NAMES
#define Indexer lucy_Indexer
#define INDEXER LUCY_INDEXER
#define Indexer_new lucy_Indexer_new
#define Indexer_init lucy_Indexer_init
#define Indexer_TRUNCATE lucy_Indexer_TRUNCATE
#define Indexer_CREATE lucy_Indexer_CREATE
#define Indexer_get_class lucy_Indexer_get_class
#define Indexer_get_class_name lucy_Indexer_get_class_name
#define Indexer_is_a lucy_Indexer_is_a
#define Indexer_Add_Doc_IMP LUCY_Indexer_Add_Doc_IMP
#define Indexer_Add_Index_IMP LUCY_Indexer_Add_Index_IMP
#define Indexer_Delete_By_Term_IMP LUCY_Indexer_Delete_By_Term_IMP
#define Indexer_Delete_By_Query_IMP LUCY_Indexer_Delete_By_Query_IMP
#define Indexer_Delete_By_Doc_ID_IMP LUCY_Indexer_Delete_By_Doc_ID_IMP
#define Indexer_Optimize_IMP LUCY_Indexer_Optimize_IMP
#define Indexer_Commit_IMP LUCY_Indexer_Commit_IMP
#define Indexer_Prepare_Commit_IMP LUCY_Indexer_Prepare_Commit_IMP
#define Indexer_Get_Schema_IMP LUCY_Indexer_Get_Schema_IMP
#define Indexer_Get_Seg_Writer_IMP LUCY_Indexer_Get_Seg_Writer_IMP
#define Indexer_Get_Stock_Doc_IMP LUCY_Indexer_Get_Stock_Doc_IMP
#define Indexer_Destroy_IMP LUCY_Indexer_Destroy_IMP
#define Indexer_To_Host LUCY_Indexer_To_Host
#define Indexer_To_Host_t LUCY_Indexer_To_Host_t
#define Indexer_Clone LUCY_Indexer_Clone
#define Indexer_Clone_t LUCY_Indexer_Clone_t
#define Indexer_Equals LUCY_Indexer_Equals
#define Indexer_Equals_t LUCY_Indexer_Equals_t
#define Indexer_Compare_To LUCY_Indexer_Compare_To
#define Indexer_Compare_To_t LUCY_Indexer_Compare_To_t
#define Indexer_Destroy LUCY_Indexer_Destroy
#define Indexer_Destroy_t LUCY_Indexer_Destroy_t
#define Indexer_To_String LUCY_Indexer_To_String
#define Indexer_To_String_t LUCY_Indexer_To_String_t
#define Indexer_Add_Doc LUCY_Indexer_Add_Doc
#define Indexer_Add_Doc_t LUCY_Indexer_Add_Doc_t
#define Indexer_Add_Index LUCY_Indexer_Add_Index
#define Indexer_Add_Index_t LUCY_Indexer_Add_Index_t
#define Indexer_Delete_By_Term LUCY_Indexer_Delete_By_Term
#define Indexer_Delete_By_Term_t LUCY_Indexer_Delete_By_Term_t
#define Indexer_Delete_By_Query LUCY_Indexer_Delete_By_Query
#define Indexer_Delete_By_Query_t LUCY_Indexer_Delete_By_Query_t
#define Indexer_Delete_By_Doc_ID LUCY_Indexer_Delete_By_Doc_ID
#define Indexer_Delete_By_Doc_ID_t LUCY_Indexer_Delete_By_Doc_ID_t
#define Indexer_Optimize LUCY_Indexer_Optimize
#define Indexer_Optimize_t LUCY_Indexer_Optimize_t
#define Indexer_Commit LUCY_Indexer_Commit
#define Indexer_Commit_t LUCY_Indexer_Commit_t
#define Indexer_Prepare_Commit LUCY_Indexer_Prepare_Commit
#define Indexer_Prepare_Commit_t LUCY_Indexer_Prepare_Commit_t
#define Indexer_Get_Schema LUCY_Indexer_Get_Schema
#define Indexer_Get_Schema_t LUCY_Indexer_Get_Schema_t
#define Indexer_Get_Seg_Writer LUCY_Indexer_Get_Seg_Writer
#define Indexer_Get_Seg_Writer_t LUCY_Indexer_Get_Seg_Writer_t
#define Indexer_Get_Stock_Doc LUCY_Indexer_Get_Stock_Doc
#define Indexer_Get_Stock_Doc_t LUCY_Indexer_Get_Stock_Doc_t
#endif /* LUCY_USE_SHORT_NAMES */
#ifdef __cplusplus
}
#endif
#endif /* H_LUCY_INDEX_INDEXER */
|