本文整理汇总了C++中Class_Make_Obj函数的典型用法代码示例。如果您正苦于以下问题:C++ Class_Make_Obj函数的具体用法?C++ Class_Make_Obj怎么用?C++ Class_Make_Obj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Class_Make_Obj函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HLWriter_new
HighlightWriter*
HLWriter_new(Schema *schema, Snapshot *snapshot, Segment *segment,
PolyReader *polyreader) {
HighlightWriter *self
= (HighlightWriter*)Class_Make_Obj(HIGHLIGHTWRITER);
return HLWriter_init(self, schema, snapshot, segment, polyreader);
}
示例2: S_load_type
static FieldType*
S_load_type(Class *klass, Obj *type_dump) {
FieldType *dummy = (FieldType*)Class_Make_Obj(klass);
FieldType *loaded = (FieldType*)FType_Load(dummy, type_dump);
DECREF(dummy);
return loaded;
}
示例3: InStream_Reopen_IMP
InStream*
InStream_Reopen_IMP(InStream *self, String *filename, int64_t offset,
int64_t len) {
InStreamIVARS *const ivars = InStream_IVARS(self);
if (!ivars->file_handle) {
THROW(ERR, "Can't Reopen() closed InStream %o", ivars->filename);
}
if (offset + len > FH_Length(ivars->file_handle)) {
THROW(ERR, "Offset + length too large (%i64 + %i64 > %i64)",
offset, len, FH_Length(ivars->file_handle));
}
Class *klass = InStream_get_class(self);
InStream *other = (InStream*)Class_Make_Obj(klass);
InStreamIVARS *const ovars = InStream_IVARS(other);
InStream_do_open(other, (Obj*)ivars->file_handle);
if (filename != NULL) {
String *temp = ovars->filename;
ovars->filename = Str_Clone(filename);
DECREF(temp);
}
ovars->offset = offset;
ovars->len = len;
InStream_Seek(other, 0);
return other;
}
示例4: ProximityCompiler_new
ProximityCompiler*
ProximityCompiler_new(ProximityQuery *parent, Searcher *searcher, float boost,
uint32_t within) {
ProximityCompiler *self =
(ProximityCompiler*)Class_Make_Obj(PROXIMITYCOMPILER);
return ProximityCompiler_init(self, parent, searcher, boost, within);
}
示例5: Bool_init_class
void
Bool_init_class() {
Boolean *true_obj = (Boolean*)Class_Make_Obj(BOOLEAN);
true_obj->value = true;
true_obj->string = Str_newf("true");
if (!Atomic_cas_ptr((void**)&Bool_true_singleton, NULL, true_obj)) {
Bool_Destroy(true_obj);
}
Boolean *false_obj = (Boolean*)Class_Make_Obj(BOOLEAN);
false_obj->value = false;
false_obj->string = Str_newf("false");
if (!Atomic_cas_ptr((void**)&Bool_false_singleton, NULL, false_obj)) {
Bool_Destroy(false_obj);
}
}
示例6: RangeQuery_new
RangeQuery*
RangeQuery_new(String *field, Obj *lower_term, Obj *upper_term,
bool include_lower, bool include_upper) {
RangeQuery *self = (RangeQuery*)Class_Make_Obj(RANGEQUERY);
return RangeQuery_init(self, field, lower_term, upper_term,
include_lower, include_upper);
}
示例7: S_load_via_load_method
static Obj*
S_load_via_load_method(Class *klass, Obj *dump) {
Obj *dummy = Class_Make_Obj(klass);
Obj *loaded = NULL;
if (Obj_is_a(dummy, ANALYZER)) {
loaded = Analyzer_Load((Analyzer*)dummy, dump);
}
else if (Obj_is_a(dummy, DOC)) {
loaded = (Obj*)Doc_Load((Doc*)dummy, dump);
}
else if (Obj_is_a(dummy, SIMILARITY)) {
loaded = (Obj*)Sim_Load((Similarity*)dummy, dump);
}
else if (Obj_is_a(dummy, FIELDTYPE)) {
loaded = FType_Load((FieldType*)dummy, dump);
}
else if (Obj_is_a(dummy, SCHEMA)) {
loaded = (Obj*)Schema_Load((Schema*)dummy, dump);
}
else if (Obj_is_a(dummy, QUERY)) {
loaded = Query_Load((Query*)dummy, dump);
}
else {
DECREF(dummy);
THROW(ERR, "Don't know how to load '%o'", Class_Get_Name(klass));
}
DECREF(dummy);
return loaded;
}
示例8: DefDelWriter_new
DefaultDeletionsWriter*
DefDelWriter_new(Schema *schema, Snapshot *snapshot, Segment *segment,
PolyReader *polyreader) {
DefaultDeletionsWriter *self
= (DefaultDeletionsWriter*)Class_Make_Obj(DEFAULTDELETIONSWRITER);
return DefDelWriter_init(self, schema, snapshot, segment, polyreader);
}
示例9: S_alt_field_type
static FieldType*
S_alt_field_type() {
StackString *name = SSTR_WRAP_UTF8("DummyFieldType2", 15);
Class *klass = Class_singleton((String*)name, DUMMYFIELDTYPE);
FieldType *self = (FieldType*)Class_Make_Obj(klass);
return FType_init(self);
}
示例10: StrIter_new
StringIterator*
StrIter_new(String *string, size_t byte_offset) {
StringIterator *self = (StringIterator*)Class_Make_Obj(STRINGITERATOR);
self->string = (String*)INCREF(string);
self->byte_offset = byte_offset;
return self;
}
示例11: Freezer_thaw
Obj*
Freezer_thaw(InStream *instream) {
String *class_name = Freezer_read_string(instream);
Class *klass = Class_singleton(class_name, NULL);
Obj *blank = Class_Make_Obj(klass);
DECREF(class_name);
return Freezer_deserialize(blank, instream);
}
示例12: DefDocReader_new
DefaultDocReader*
DefDocReader_new(Schema *schema, Folder *folder, Snapshot *snapshot,
Vector *segments, int32_t seg_tick) {
DefaultDocReader *self
= (DefaultDocReader*)Class_Make_Obj(DEFAULTDOCREADER);
return DefDocReader_init(self, schema, folder, snapshot, segments,
seg_tick);
}
示例13: S_SFWriterElem_create
static SFWriterElem*
S_SFWriterElem_create(Obj *value, int32_t doc_id) {
SFWriterElem *self = (SFWriterElem*)Class_Make_Obj(SFWRITERELEM);
SFWriterElemIVARS *ivars = SFWriterElem_IVARS(self);
ivars->value = value;
ivars->doc_id = doc_id;
return self;
}
示例14: ReqOptMatcher_new
RequiredOptionalMatcher*
ReqOptMatcher_new(Similarity *similarity, Matcher *required_matcher,
Matcher *optional_matcher) {
RequiredOptionalMatcher *self
= (RequiredOptionalMatcher*)Class_Make_Obj(REQUIREDOPTIONALMATCHER);
return ReqOptMatcher_init(self, similarity, required_matcher,
optional_matcher);
}
示例15: Str_new_steal_utf8
String*
Str_new_steal_utf8(char *utf8, size_t size) {
if (!StrHelp_utf8_valid(utf8, size)) {
DIE_INVALID_UTF8(utf8, size);
}
String *self = (String*)Class_Make_Obj(STRING);
return Str_init_steal_trusted_utf8(self, utf8, size);
}