本文整理汇总了C++中ConstTableRef::get_descriptor方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstTableRef::get_descriptor方法的具体用法?C++ ConstTableRef::get_descriptor怎么用?C++ ConstTableRef::get_descriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstTableRef
的用法示例。
在下文中一共展示了ConstTableRef::get_descriptor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}