collection_c.cpp 676 字节
Newer Older
B
bigsheeper 已提交
1
#include "collection_c.h"
2
#include "Collection.h"
B
bigsheeper 已提交
3 4

CCollection
5
NewCollection(const char* collection_name, const char* schema_conf) {
6 7
    auto name = std::string(collection_name);
    auto conf = std::string(schema_conf);
B
bigsheeper 已提交
8

G
GuoRentong 已提交
9
    auto collection = std::make_unique<milvus::segcore::Collection>(name, conf);
10

11 12 13
    // TODO: delete print
    std::cout << "create collection " << collection_name << std::endl;
    return (void*)collection.release();
B
bigsheeper 已提交
14 15 16 17
}

void
DeleteCollection(CCollection collection) {
G
GuoRentong 已提交
18
    auto col = (milvus::segcore::Collection*)collection;
B
bigsheeper 已提交
19

20 21 22
    // TODO: delete print
    std::cout << "delete collection " << col->get_collection_name() << std::endl;
    delete col;
B
bigsheeper 已提交
23
}