Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
reader_util.h
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #pragma once
21 
22 #include <memory>
23 #include <string>
24 #include <utility>
25 #include <vector>
26 
27 #include "graphar/fwd.h"
28 
29 namespace graphar::util {
30 struct FilterOptions {
31  // The row filter to apply to the table.
32  Filter filter = nullptr;
33  // The columns to include in the table. Select all columns by default.
34  ColumnNames columns = std::nullopt;
35 
36  FilterOptions() {}
37  FilterOptions(Filter filter, ColumnNames columns)
38  : filter(filter), columns(columns) {}
39 };
40 
41 Status CheckFilterOptions(
42  const FilterOptions& filter_options,
43  const std::shared_ptr<PropertyGroup>& property_group) noexcept;
44 
45 Result<std::pair<IdType, IdType>> GetAdjListOffsetOfVertex(
46  const std::shared_ptr<EdgeInfo>& edge_info, const std::string& prefix,
47  AdjListType adj_list_type, IdType vid) noexcept;
48 
49 Result<IdType> GetVertexChunkNum(
50  const std::string& prefix,
51  const std::shared_ptr<VertexInfo>& vertex_info) noexcept;
52 
53 Result<IdType> GetVertexNum(
54  const std::string& prefix,
55  const std::shared_ptr<VertexInfo>& vertex_info) noexcept;
56 
57 Result<IdType> GetVertexChunkNum(const std::string& prefix,
58  const std::shared_ptr<EdgeInfo>& edge_info,
59  AdjListType adj_list_type) noexcept;
60 
61 Result<IdType> GetVertexNum(const std::string& prefix,
62  const std::shared_ptr<EdgeInfo>& edge_info,
63  AdjListType adj_list_type) noexcept;
64 
65 Result<IdType> GetEdgeChunkNum(const std::string& prefix,
66  const std::shared_ptr<EdgeInfo>& edge_info,
67  AdjListType adj_list_type,
68  IdType vertex_chunk_index) noexcept;
69 
70 Result<IdType> GetEdgeNum(const std::string& prefix,
71  const std::shared_ptr<EdgeInfo>& edge_info,
72  AdjListType adj_list_type,
73  IdType vertex_chunk_index) noexcept;
74 
75 } // namespace graphar::util
Status outcome object (success or error)
Definition: status.h:123