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


C++ ConstTableRef类代码示例

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


在下文中一共展示了ConstTableRef类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_schema_version

uint64_t ObjectStore::get_schema_version(const Group *group) {
    ConstTableRef table = group->get_table(c_metadataTableName);
    if (!table || table->get_column_count() == 0) {
        return ObjectStore::NotVersioned;
    }
    return table->get_int(c_versionColumnIndex, c_zeroRowIndex);
}
开发者ID:0atme0,项目名称:tutu1,代码行数:7,代码来源:object_store.cpp

示例2: get_primary_key_for_object

StringData ObjectStore::get_primary_key_for_object(const Group *group, StringData object_type) {
    ConstTableRef table = group->get_table(c_primaryKeyTableName);
    if (!table) {
        return "";
    }
    size_t row = table->find_first_string(c_primaryKeyObjectClassColumnIndex, object_type);
    if (row == not_found) {
        return "";
    }
    return table->get_string(c_primaryKeyPropertyNameColumnIndex, row);
}
开发者ID:0atme0,项目名称:tutu1,代码行数:11,代码来源:object_store.cpp

示例3: is_empty

bool ObjectStore::is_empty(const Group *group) {
    for (size_t i = 0; i < group->size(); i++) {
        ConstTableRef table = group->get_table(i);
        std::string object_type = object_type_for_table_name(table->get_name());
        if (!object_type.length()) {
            continue;
        }
        if (!table->is_empty()) {
            return false;
        }
    }
    return true;
}
开发者ID:0atme0,项目名称:tutu1,代码行数:13,代码来源:object_store.cpp

示例4: table_for_object_type

void ObjectStore::validate_primary_column_uniqueness(const Group *group, Schema const& schema) {
    for (auto& object_schema : schema) {
        auto primary_prop = object_schema.primary_key_property();
        if (!primary_prop) {
            continue;
        }

        ConstTableRef table = table_for_object_type(group, object_schema.name);
        if (table->get_distinct_view(primary_prop->table_column).size() != table->size()) {
            throw DuplicatePrimaryKeyValueException(object_schema.name, *primary_prop);
        }
    }
}
开发者ID:0atme0,项目名称:tutu1,代码行数:13,代码来源:object_store.cpp

示例5:

util::Optional<Property> ObjectStore::property_for_column_index(ConstTableRef& table, size_t column_index)
{
    StringData column_name = table->get_column_name(column_index);

#if REALM_ENABLE_SYNC
    // The object ID column is an implementation detail, and is omitted from the schema.
    // FIXME: Consider filtering out all column names starting with `!`.
    if (column_name == sync::object_id_column_name)
        return util::none;
#endif

    if (table->get_column_type(column_index) == type_Table) {
        auto subdesc = table->get_subdescriptor(column_index);
        if (subdesc->get_column_count() != 1 || subdesc->get_column_name(0) != ObjectStore::ArrayColumnName)
            return util::none;
    }

    Property property;
    property.name = column_name;
    property.type = ObjectSchema::from_core_type(*table->get_descriptor(), column_index);
    property.is_indexed = table->has_search_index(column_index);
    property.table_column = column_index;

    if (property.type == PropertyType::Object) {
        // set link type for objects and arrays
        ConstTableRef linkTable = table->get_link_target(column_index);
        property.object_type = ObjectStore::object_type_for_table_name(linkTable->get_name().data());
    }
    return property;
}
开发者ID:FancyPixel,项目名称:gulps,代码行数:30,代码来源:object_store.cpp

示例6: name

ObjectSchema::ObjectSchema(Group const& group, StringData name, size_t index) : name(name) {
    ConstTableRef table;
    if (index < group.size()) {
        table = group.get_table(index);
    }
    else {
        table = ObjectStore::table_for_object_type(group, name);
    }

    size_t count = table->get_column_count();
    persisted_properties.reserve(count);
    for (size_t col = 0; col < count; col++) {
        if (auto property = ObjectStore::property_for_column_index(table, col)) {
            persisted_properties.push_back(std::move(property.value()));
        }
    }

    primary_key = realm::ObjectStore::get_primary_key_for_object(group, name);
    set_primary_key_property();
}
开发者ID:Iracle,项目名称:Rao,代码行数:20,代码来源:object_schema.cpp

示例7: name

ObjectSchema::ObjectSchema(const Group *group, const std::string &name) : name(name) {
    ConstTableRef table = ObjectStore::table_for_object_type(group, name);

    size_t count = table->get_column_count();
    properties.reserve(count);
    for (size_t col = 0; col < count; col++) {
        Property property;
        property.name = table->get_column_name(col).data();
        property.type = (PropertyType)table->get_column_type(col);
        property.is_indexed = table->has_search_index(col);
        property.is_primary = false;
        property.is_nullable = table->is_nullable(col) || property.type == PropertyType::Object;
        property.table_column = col;
        if (property.type == PropertyType::Object || property.type == PropertyType::Array) {
            // set link type for objects and arrays
            ConstTableRef linkTable = table->get_link_target(col);
            property.object_type = ObjectStore::object_type_for_table_name(linkTable->get_name().data());
        }
        properties.push_back(std::move(property));
    }

    primary_key = realm::ObjectStore::get_primary_key_for_object(group, name);
    set_primary_key_property();
}
开发者ID:BizBuzz,项目名称:Backend,代码行数:24,代码来源:object_schema.cpp

示例8: operator

 int64_t operator()(ConstTableRef v) const
 {
     return v->size();
 }
开发者ID:AlanAherne,项目名称:BabyTunes,代码行数:4,代码来源:query_operators.hpp


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