PGROUTING  2.6
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 
27 #ifndef INCLUDE_CPP_COMMON_BASIC_VERTEX_H_
28 #define INCLUDE_CPP_COMMON_BASIC_VERTEX_H_
29 #pragma once
30 
31 #include <vector>
32 #include <ostream>
33 
34 #include "c_types/pgr_edge_t.h"
35 
36 
37 
38 namespace pgrouting {
39 
40 class Basic_vertex {
41  public:
43  id(0) {}
45  id(v.id) {}
46 
47  explicit Basic_vertex(const int64_t _id) :
48  id(_id) {}
49 
50  Basic_vertex(const pgr_edge_t &other, bool is_source) :
51  id(is_source? other.source : other.target) {}
52 
53  void cp_members(const Basic_vertex &other) {
54  this->id = other.id;
55  }
56 
57 
58  friend std::ostream& operator<<(std::ostream& log, const Basic_vertex &v);
59  public:
60  int64_t id;
61  size_t vertex_index;
62 };
63 
64 size_t check_vertices(std::vector < Basic_vertex > vertices);
65 
66 
67 std::vector < Basic_vertex > extract_vertices(
68  std::vector < Basic_vertex > vertices,
69  const pgr_edge_t *data_edges, int64_t count);
70 
71 std::vector < Basic_vertex > extract_vertices(
72  std::vector < Basic_vertex > vertices,
73  const std::vector < pgr_edge_t > data_edges);
74 
75 std::vector < Basic_vertex > extract_vertices(
76  const pgr_edge_t *data_edges, int64_t count);
77 
78 std::vector < Basic_vertex > extract_vertices(
79  const std::vector < pgr_edge_t > data_edges);
80 
81 
82 } // namespace pgrouting
83 
84 #endif // INCLUDE_CPP_COMMON_BASIC_VERTEX_H_
Basic_vertex(const pgr_edge_t &other, bool is_source)
Definition: basic_vertex.h:50
void cp_members(const Basic_vertex &other)
Definition: basic_vertex.h:53
Basic_vertex(const int64_t _id)
Definition: basic_vertex.h:47
std::vector< Basic_vertex > extract_vertices(std::vector< Basic_vertex > vertices, const std::vector< pgr_edge_t > data_edges)
Book keeping class for swapping orders between vehicles.
Definition: basic_edge.cpp:28
Basic_vertex(const Basic_vertex &v)
Definition: basic_vertex.h:44
size_t check_vertices(std::vector< Basic_vertex > vertices)
friend std::ostream & operator<<(std::ostream &log, const Basic_vertex &v)