pgRouting
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
basic_vertex.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2  *
3 
4 Copyright (c) 2015 Celia Virginia Vergara Castillo
5 vicky_vergara@hotmail.com
6 
7 ------
8 
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 
23 ********************************************************************PGR-GNU*/
24 
25 #ifndef SRC_COMMON_SRC_BASIC_VERTEX_H_
26 #define SRC_COMMON_SRC_BASIC_VERTEX_H_
27 #pragma once
28 
29 #include <vector>
30 
31 #include "./pgr_types.h"
32 
33 
34 namespace pgrouting {
35 
36 class Basic_vertex {
37  public:
39  id(0) {}
41  id(v.id) {}
42 
43  explicit Basic_vertex(const int64_t _id) :
44  id(_id) {}
45 
46  Basic_vertex(const pgr_edge_t &other, bool is_source) :
47  id(is_source? other.source : other.target) {}
48 
49  void cp_members(const Basic_vertex &other) {
50  this->id = other.id;
51  }
52 
53 
54  friend std::ostream& operator<<(std::ostream& log, const Basic_vertex &v);
55  public:
56  int64_t id;
57 };
58 
59 size_t check_vertices(std::vector < Basic_vertex > vertices);
60 
61 
62 std::vector < Basic_vertex > extract_vertices(
63  std::vector < Basic_vertex > vertices,
64  const pgr_edge_t *data_edges, int64_t count);
65 
66 std::vector < Basic_vertex > extract_vertices(
67  std::vector < Basic_vertex > vertices,
68  const std::vector < pgr_edge_t > data_edges);
69 
70 std::vector < Basic_vertex > extract_vertices(
71  const pgr_edge_t *data_edges, int64_t count);
72 
73 std::vector < Basic_vertex > extract_vertices(
74  const std::vector < pgr_edge_t > data_edges);
75 
76 
77 } // namespace pgrouting
78 
79 #endif // SRC_COMMON_SRC_BASIC_VERTEX_H_
Basic_vertex(const pgr_edge_t &other, bool is_source)
Definition: basic_vertex.h:46
void cp_members(const Basic_vertex &other)
Definition: basic_vertex.h:49
Basic_vertex(const int64_t _id)
Definition: basic_vertex.h:43
std::vector< Basic_vertex > extract_vertices(std::vector< Basic_vertex > vertices, const std::vector< pgr_edge_t > data_edges)
Basic_vertex(const Basic_vertex &v)
Definition: basic_vertex.h:40
size_t check_vertices(std::vector< Basic_vertex > vertices)
friend std::ostream & operator<<(std::ostream &log, const Basic_vertex &v)