当前位置: 首页>>代码示例>>C++>>正文


C++ Class_Make_Obj函数代码示例

本文整理汇总了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);
}
开发者ID:github188,项目名称:SimpleCode,代码行数:7,代码来源:HighlightWriter.c

示例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;
}
开发者ID:lazycrazyowl,项目名称:lucy,代码行数:7,代码来源:Schema.c

示例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;
}
开发者ID:zilent1,项目名称:udesc-pra-rafael-lucy,代码行数:27,代码来源:InStream.c

示例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);
}
开发者ID:github188,项目名称:SimpleCode,代码行数:7,代码来源:ProximityQuery.c

示例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);
    }
}
开发者ID:rectang,项目名称:lucy-clownfish,代码行数:16,代码来源:Boolean.c

示例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);
}
开发者ID:apache,项目名称:lucy,代码行数:7,代码来源:RangeQuery.c

示例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;
}
开发者ID:rectang,项目名称:lucy,代码行数:30,代码来源:Freezer.c

示例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);
}
开发者ID:github188,项目名称:SimpleCode,代码行数:7,代码来源:DeletionsWriter.c

示例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);
}
开发者ID:github188,项目名称:SimpleCode,代码行数:7,代码来源:TestFieldType.c

示例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;
}
开发者ID:srcclrapache1,项目名称:lucy-clownfish,代码行数:7,代码来源:String.c

示例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);
}
开发者ID:rectang,项目名称:lucy,代码行数:8,代码来源:Freezer.c

示例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);
}
开发者ID:kidaa,项目名称:lucy,代码行数:8,代码来源:DocReader.c

示例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;
}
开发者ID:zilent1,项目名称:udesc-pra-rafael-lucy,代码行数:8,代码来源:SortFieldWriter.c

示例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);
}
开发者ID:github188,项目名称:SimpleCode,代码行数:8,代码来源:RequiredOptionalMatcher.c

示例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);
}
开发者ID:srcclrapache1,项目名称:lucy-clownfish,代码行数:8,代码来源:String.c


注:本文中的Class_Make_Obj函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。