载入中...
搜索中...
无匹配项
multilinestring_ref.cuh
1/*
2 * Copyright (c) 2022, NVIDIA CORPORATION.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://apache.ac.cn/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <cuspatial/cuda_utils.hpp>
19#include <cuspatial/detail/range/enumerate_range.cuh>
20
21namespace cuspatial {
22
29template <typename PartIterator, typename VecIterator>
30class multilinestring_ref {
31 public
32 CUSPATIAL_HOST_DEVICE multilinestring_ref(PartIterator part_begin,
33 PartIterator part_end,
34 VecIterator point_begin,
35 VecIterator point_end);
37 CUSPATIAL_HOST_DEVICE auto num_linestrings() const;
39 CUSPATIAL_HOST_DEVICE auto size() const { return num_linestrings(); }
40
42 CUSPATIAL_HOST_DEVICE bool is_empty() const { return num_linestrings() == 0; }
43
45 CUSPATIAL_HOST_DEVICE auto part_begin() const;
47 CUSPATIAL_HOST_DEVICE auto part_end() const;
48
50 CUSPATIAL_HOST_DEVICE auto point_begin() const;
52 CUSPATIAL_HOST_DEVICE auto point_end() const;
53
55 CUSPATIAL_HOST_DEVICE auto begin() const { return part_begin(); }
57 CUSPATIAL_HOST_DEVICE auto end() const { return part_end(); }
58
60 CUSPATIAL_HOST_DEVICE auto enumerate() const { return detail::enumerate_range{begin(), end()}; }
61
63 template <typename IndexType>
64 CUSPATIAL_HOST_DEVICE auto operator[](IndexType linestring_idx) const;
65
66 protected
67 PartIterator _part_begin;
68 PartIterator _part_end;
69 VecIterator _point_begin;
70 VecIterator _point_end;
71};
72
73} // namespace cuspatial
74
75#include <cuspatial/detail/geometry_collection/multilinestring_ref.cuh>
CUSPATIAL_HOST_DEVICE auto end() const
返回指向 multilinestring 中最后一个 linestring 之后位置的迭代器。
CUSPATIAL_HOST_DEVICE bool is_empty() const
如果此 multilinestring 包含 0 个 linestring,则返回 true。
CUSPATIAL_HOST_DEVICE auto point_begin() const
返回指向 multilinestring 中第一个点的迭代器。
CUSPATIAL_HOST_DEVICE auto part_end() const
返回指向最后一个 linestring 之后位置的迭代器。
CUSPATIAL_HOST_DEVICE auto begin() const
返回指向 multilinestring 中第一个 linestring 的迭代器。
CUSPATIAL_HOST_DEVICE auto enumerate() const
返回 linestring 的枚举范围。
CUSPATIAL_HOST_DEVICE auto operator[](IndexType linestring_idx) const
返回 multilinestring 中的第 linestring_idx 个 linestring。
CUSPATIAL_HOST_DEVICE auto num_linestrings() const
返回 multilinestring 中 linestring 的数量。
CUSPATIAL_HOST_DEVICE auto size() const
返回 multilinestring 中 linestring 的数量。
CUSPATIAL_HOST_DEVICE auto point_end() const
返回指向 multilinestring 中最后一个点之后位置的迭代器。
CUSPATIAL_HOST_DEVICE auto part_begin() const
返回指向第一个 linestring 的迭代器。