當前位置: 首頁>>代碼示例>>C++>>正文


C++ CERTIFY函數代碼示例

本文整理匯總了C++中CERTIFY函數的典型用法代碼示例。如果您正苦於以下問題:C++ CERTIFY函數的具體用法?C++ CERTIFY怎麽用?C++ CERTIFY使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CERTIFY函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: TermQuery_Dump_IMP

Obj*
TermQuery_Dump_IMP(TermQuery *self) {
    TermQueryIVARS *ivars = TermQuery_IVARS(self);
    TermQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(TERMQUERY, LUCY_TermQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    Hash_Store_Utf8(dump, "term", 4, Freezer_dump(ivars->term));
    return (Obj*)dump;
}
開發者ID:hernan604,項目名稱:lucy,代碼行數:10,代碼來源:TermQuery.c

示例2: PolyHLReader_init

PolyHighlightReader*
PolyHLReader_init(PolyHighlightReader *self, VArray *readers,
                  I32Array *offsets) {
    HLReader_init((HighlightReader*)self, NULL, NULL, NULL, NULL, -1);
    for (uint32_t i = 0, max = VA_Get_Size(readers); i < max; i++) {
        CERTIFY(VA_Fetch(readers, i), HIGHLIGHTREADER);
    }
    self->readers = (VArray*)INCREF(readers);
    self->offsets = (I32Array*)INCREF(offsets);
    return self;
}
開發者ID:pavansondur,項目名稱:lucy,代碼行數:11,代碼來源:HighlightReader.c

示例3: S_do_init

static PhraseQuery*
S_do_init(PhraseQuery *self, String *field, Vector *terms, float boost) {
    Query_init((Query*)self, boost);
    PhraseQueryIVARS *const ivars = PhraseQuery_IVARS(self);
    for (uint32_t i = 0, max = Vec_Get_Size(terms); i < max; i++) {
        CERTIFY(Vec_Fetch(terms, i), OBJ);
    }
    ivars->field = field;
    ivars->terms = terms;
    return self;
}
開發者ID:zilent1,項目名稱:udesc-pra-rafael-lucy,代碼行數:11,代碼來源:PhraseQuery.c

示例4: PolyDocReader_init

PolyDocReader*
PolyDocReader_init(PolyDocReader *self, Vector *readers, I32Array *offsets) {
    DocReader_init((DocReader*)self, NULL, NULL, NULL, NULL, -1);
    PolyDocReaderIVARS *const ivars = PolyDocReader_IVARS(self);
    for (uint32_t i = 0, max = Vec_Get_Size(readers); i < max; i++) {
        CERTIFY(Vec_Fetch(readers, i), DOCREADER);
    }
    ivars->readers = (Vector*)INCREF(readers);
    ivars->offsets = (I32Array*)INCREF(offsets);
    return self;
}
開發者ID:kidaa,項目名稱:lucy,代碼行數:11,代碼來源:DocReader.c

示例5: BBSortEx_feed

void
BBSortEx_feed(BBSortEx *self, void *data) {
    SortEx_feed((SortExternal*)self, data);

    // Flush() if necessary.
    ByteBuf *bytebuf = (ByteBuf*)CERTIFY(*(ByteBuf**)data, BYTEBUF);
    self->mem_consumed += BB_Get_Size(bytebuf);
    if (self->mem_consumed >= self->mem_thresh) {
        BBSortEx_Flush(self);
    }
}
開發者ID:pavansondur,項目名稱:lucy,代碼行數:11,代碼來源:BBSortEx.c

示例6: StrIter_Compare_To_IMP

int32_t
StrIter_Compare_To_IMP(StringIterator *self, Obj *other) {
    StringIterator *twin = (StringIterator*)CERTIFY(other, STRINGITERATOR);
    if (self->string != twin->string) {
        THROW(ERR, "Can't compare iterators of different strings");
        UNREACHABLE_RETURN(int32_t);
    }
    if (self->byte_offset < twin->byte_offset) { return -1; }
    if (self->byte_offset > twin->byte_offset) { return 1; }
    return 0;
}
開發者ID:srcclrapache1,項目名稱:lucy-clownfish,代碼行數:11,代碼來源:String.c

示例7: PolyAnalyzer_Dump_IMP

Obj*
PolyAnalyzer_Dump_IMP(PolyAnalyzer *self) {
    PolyAnalyzerIVARS *const ivars = PolyAnalyzer_IVARS(self);
    PolyAnalyzer_Dump_t super_dump
        = SUPER_METHOD_PTR(POLYANALYZER, LUCY_PolyAnalyzer_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    if (ivars->analyzers) {
        Hash_Store_Utf8(dump, "analyzers", 9,
                        Freezer_dump((Obj*)ivars->analyzers));
    }
    return (Obj*)dump;
}
開發者ID:hernan604,項目名稱:lucy,代碼行數:12,代碼來源:PolyAnalyzer.c

示例8: ProximityQuery_Dump_IMP

Obj*
ProximityQuery_Dump_IMP(ProximityQuery *self) {
    ProximityQueryIVARS *ivars = ProximityQuery_IVARS(self);
    ProximityQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(PROXIMITYQUERY, LUCY_ProximityQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    Hash_Store_Utf8(dump, "terms", 5, Freezer_dump((Obj*)ivars->terms));
    Hash_Store_Utf8(dump, "within", 6,
                    (Obj*)Str_newf("%i64", (int64_t)ivars->within));
    return (Obj*)dump;
}
開發者ID:github188,項目名稱:SimpleCode,代碼行數:12,代碼來源:ProximityQuery.c

示例9: S_do_init

static PhraseQuery*
S_do_init(PhraseQuery *self, CharBuf *field, VArray *terms, float boost)
{
    uint32_t i, max;
    Query_init((Query*)self, boost);
    for (i = 0, max = VA_Get_Size(terms); i < max; i++) {
        CERTIFY(VA_Fetch(terms, i), OBJ);
    }
    self->field = field;
    self->terms = terms;
    return self;
}
開發者ID:gitpan,項目名稱:KinoSearch,代碼行數:12,代碼來源:PhraseQuery.c

示例10: LeafQuery_Dump_IMP

Obj*
LeafQuery_Dump_IMP(LeafQuery *self) {
    LeafQueryIVARS *ivars = LeafQuery_IVARS(self);
    LeafQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(LEAFQUERY, LUCY_LeafQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    if (ivars->field) {
        Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    }
    Hash_Store_Utf8(dump, "text", 4, Freezer_dump((Obj*)ivars->text));
    return (Obj*)dump;
}
開發者ID:apache,項目名稱:lucy,代碼行數:12,代碼來源:LeafQuery.c

示例11: PolyHLReader_init

PolyHighlightReader*
PolyHLReader_init(PolyHighlightReader *self, Vector *readers,
                  I32Array *offsets) {
    HLReader_init((HighlightReader*)self, NULL, NULL, NULL, NULL, -1);
    PolyHighlightReaderIVARS *const ivars = PolyHLReader_IVARS(self);
    for (size_t i = 0, max = Vec_Get_Size(readers); i < max; i++) {
        CERTIFY(Vec_Fetch(readers, i), HIGHLIGHTREADER);
    }
    ivars->readers = (Vector*)INCREF(readers);
    ivars->offsets = (I32Array*)INCREF(offsets);
    return self;
}
開發者ID:apache,項目名稱:lucy,代碼行數:12,代碼來源:HighlightReader.c

示例12: S_add_string_field

static void
S_add_string_field(Schema *self, String *field, FieldType *type) {
    SchemaIVARS *const ivars = Schema_IVARS(self);
    StringType *string_type = (StringType*)CERTIFY(type, STRINGTYPE);
    Similarity *sim         = StringType_Make_Similarity(string_type);

    // Cache helpers.
    Hash_Store(ivars->sims, field, (Obj*)sim);

    // Store FieldType.
    Hash_Store(ivars->types, field, INCREF(type));
}
開發者ID:lazycrazyowl,項目名稱:lucy,代碼行數:12,代碼來源:Schema.c

示例13: SnowStop_Dump_IMP

Obj*
SnowStop_Dump_IMP(SnowballStopFilter *self) {
    SnowballStopFilterIVARS *ivars = SnowStop_IVARS(self);
    SnowStop_Dump_t super_dump
        = SUPER_METHOD_PTR(SNOWBALLSTOPFILTER, LUCY_SnowStop_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    if (ivars->stoplist) {
        Hash_Store_Utf8(dump, "stoplist", 8,
                        Freezer_dump((Obj*)ivars->stoplist));
    }
    return (Obj*)dump;
}
開發者ID:carriercomm,項目名稱:lucy,代碼行數:12,代碼來源:SnowballStopFilter.c

示例14: test_Peek_and_Pop_All

static void
test_Peek_and_Pop_All(TestBatchRunner *runner) {
    NumPriorityQueue *pq = NumPriQ_new(5);
    Float64 *val;

    S_insert_num(pq, 3);
    S_insert_num(pq, 1);
    S_insert_num(pq, 2);
    S_insert_num(pq, 20);
    S_insert_num(pq, 10);
    val = (Float64*)CERTIFY(NumPriQ_Peek(pq), FLOAT64);
    TEST_INT_EQ(runner, (long)Float64_Get_Value(val), 1,
                "peek at the least item in the queue");

    VArray  *got = NumPriQ_Pop_All(pq);
    val = (Float64*)CERTIFY(VA_Fetch(got, 0), FLOAT64);
    TEST_INT_EQ(runner, (long)Float64_Get_Value(val), 20, "pop_all");
    val = (Float64*)CERTIFY(VA_Fetch(got, 1), FLOAT64);
    TEST_INT_EQ(runner, (long)Float64_Get_Value(val), 10, "pop_all");
    val = (Float64*)CERTIFY(VA_Fetch(got, 2), FLOAT64);
    TEST_INT_EQ(runner, (long)Float64_Get_Value(val),  3, "pop_all");
    val = (Float64*)CERTIFY(VA_Fetch(got, 3), FLOAT64);
    TEST_INT_EQ(runner, (long)Float64_Get_Value(val),  2, "pop_all");
    val = (Float64*)CERTIFY(VA_Fetch(got, 4), FLOAT64);
    TEST_INT_EQ(runner, (long)Float64_Get_Value(val),  1, "pop_all");

    DECREF(got);
    DECREF(pq);
}
開發者ID:github188,項目名稱:SimpleCode,代碼行數:29,代碼來源:TestPriorityQueue.c

示例15: test_offsets

static void
test_offsets(TestBatchRunner *runner) {
    Folder *folder = S_folder_with_contents();
    CompoundFileWriter *cf_writer = CFWriter_new(folder);
    Hash    *cf_metadata;
    Hash    *files;

    CFWriter_Consolidate(cf_writer);

    cf_metadata = (Hash*)CERTIFY(
                      Json_slurp_json(folder, cfmeta_file), HASH);
    files = (Hash*)CERTIFY(
                Hash_Fetch_Utf8(cf_metadata, "files", 5), HASH);

    bool     offsets_ok = true;

    TEST_TRUE(runner, Hash_Get_Size(files) > 0, "Multiple files");

    HashIterator *iter = HashIter_new(files);
    while (HashIter_Next(iter)) {
        String *file   = HashIter_Get_Key(iter);
        Hash   *stats  = (Hash*)CERTIFY(HashIter_Get_Value(iter), HASH);
        Obj    *offset = CERTIFY(Hash_Fetch_Utf8(stats, "offset", 6), OBJ);
        int64_t offs   = Obj_To_I64(offset);
        if (offs % 8 != 0) {
            offsets_ok = false;
            FAIL(runner, "Offset %" PRId64 " for %s not a multiple of 8",
                 offset, Str_Get_Ptr8(file));
            break;
        }
    }
    DECREF(iter);
    if (offsets_ok) {
        PASS(runner, "All offsets are multiples of 8");
    }

    DECREF(cf_metadata);
    DECREF(cf_writer);
    DECREF(folder);
}
開發者ID:carriercomm,項目名稱:lucy,代碼行數:40,代碼來源:TestCompoundFileWriter.c


注:本文中的CERTIFY函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。