本文整理汇总了C++中TileIndex::is_nonnegative_all方法的典型用法代码示例。如果您正苦于以下问题:C++ TileIndex::is_nonnegative_all方法的具体用法?C++ TileIndex::is_nonnegative_all怎么用?C++ TileIndex::is_nonnegative_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TileIndex
的用法示例。
在下文中一共展示了TileIndex::is_nonnegative_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: split_tile_if_needed
TileIndex Channel::split_tile_if_needed(TileIndex ti, Tile &tile) {
TileIndex new_root_index = TileIndex::null();
if (tile.binary_length() <= m_max_tile_size) return new_root_index;
Tile children[2];
TileIndex child_indexes[2];
if (verbosity) log_f("split_tile_if_needed: splitting tile %s", ti.to_string().c_str());
// If we're splitting an "all" tile, it means that until now the channel has only had one tile's worth of
// data, and that a proper root tile location couldn't be selected. Select a new root tile now.
if (ti.is_nonnegative_all()) {
// TODO: this breaks if all samples are at one time
ti = new_root_index = TileIndex::index_containing(Range(tile.first_sample_time(), tile.last_sample_time()));
if (verbosity) log_f("split_tile_if_needed: Moving root tile to %s", ti.to_string().c_str());
}
child_indexes[0]= ti.left_child();
child_indexes[1]= ti.right_child();
double split_time = ti.right_child().start_time();
split_samples(tile.double_samples, split_time, children[0], children[1]);
split_samples(tile.string_samples, split_time, children[0], children[1]);
for (int i = 0; i < 2; i++) {
assert(!has_tile(child_indexes[i]));
assert(split_tile_if_needed(child_indexes[i], children[i]) == TileIndex::null());
write_tile(child_indexes[i], children[i]);
}
create_parent_tile_from_children(ti, tile, children);
return new_root_index;
}