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


C++ ConstTableRef::get_name方法代码示例

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


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

示例1:

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

示例2: 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

示例3: 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


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