• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Class_Make_Obj函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Class_Make_Obj函数的典型用法代码示例。如果您正苦于以下问题:C++ Class_Make_Obj函数的具体用法?C++ Class_Make_Obj怎么用?C++ Class_Make_Obj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Class_Make_Obj函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: TextSortCache_new

TextSortCache*
TextSortCache_new(String *field, FieldType *type, int32_t cardinality,
                  int32_t doc_max, int32_t null_ord, int32_t ord_width,
                  InStream *ord_in, InStream *ix_in, InStream *dat_in) {
    TextSortCache *self = (TextSortCache*)Class_Make_Obj(TEXTSORTCACHE);
    return TextSortCache_init(self, field, type, cardinality, doc_max,
                              null_ord, ord_width, ord_in, ix_in, dat_in);
}
开发者ID:carriercomm,项目名称:lucy,代码行数:8,代码来源:TextSortCache.c


示例17: InStream_Clone_IMP

InStream*
InStream_Clone_IMP(InStream *self) {
    InStreamIVARS *const ivars = InStream_IVARS(self);
    Class *klass = InStream_get_class(self);
    InStream *twin = (InStream*)Class_Make_Obj(klass);
    InStream_do_open(twin, (Obj*)ivars->file_handle);
    InStream_Seek(twin, SI_tell(self));
    return twin;
}
开发者ID:zilent1,项目名称:udesc-pra-rafael-lucy,代码行数:9,代码来源:InStream.c


示例18: Str_Cat_Trusted_Utf8_IMP

String*
Str_Cat_Trusted_Utf8_IMP(String *self, const char* ptr, size_t size) {
    size_t  result_size = self->size + size;
    char   *result_ptr  = (char*)MALLOCATE(result_size + 1);
    memcpy(result_ptr, self->ptr, self->size);
    memcpy(result_ptr + self->size, ptr, size);
    result_ptr[result_size] = '\0';
    String *result = (String*)Class_Make_Obj(STRING);
    return Str_init_steal_trusted_utf8(result, result_ptr, result_size);
}
开发者ID:srcclrapache1,项目名称:lucy-clownfish,代码行数:10,代码来源:String.c


示例19: ScorePost_Make_Matcher_IMP

ScorePostingMatcher*
ScorePost_Make_Matcher_IMP(ScorePosting *self, Similarity *sim,
                           PostingList *plist, Compiler *compiler,
                           bool need_score) {
    ScorePostingMatcher *matcher
        = (ScorePostingMatcher*)Class_Make_Obj(SCOREPOSTINGMATCHER);
    UNUSED_VAR(self);
    UNUSED_VAR(need_score);
    return ScorePostMatcher_init(matcher, sim, plist, compiler);
}
开发者ID:github188,项目名称:SimpleCode,代码行数:10,代码来源:ScorePosting.c


示例20: S_new_testobj

static Obj*
S_new_testobj() {
    StackString *class_name = SSTR_WRAP_UTF8("TestObj", 7);
    Obj *obj;
    Class *klass = Class_fetch_class((String*)class_name);
    if (!klass) {
        klass = Class_singleton((String*)class_name, OBJ);
    }
    obj = Class_Make_Obj(klass);
    return Obj_init(obj);
}
开发者ID:timwilkens,项目名称:lucy-clownfish,代码行数:11,代码来源:TestObj.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Classify函数代码示例发布时间:2022-05-30
下一篇:
C++ Class函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap