PGROUTING  3.2
ch_vertex.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File: ch_vertex.h
3 
4 Generated with Template by:
5 Copyright (c) 2015 pgRouting developers
7 
8 Function's developer:
9 Copyright (c) 2016 Rohith Reddy
10 Mail:
11 
12 ------
13 
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18 
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23 
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 
28  ********************************************************************PGR-GNU*/
29 #ifndef INCLUDE_CPP_COMMON_CH_VERTEX_H_
30 #define INCLUDE_CPP_COMMON_CH_VERTEX_H_
31 #include <iostream>
32 #include <sstream>
33 #include <vector>
34 
35 #include "c_types/pgr_edge_t.h"
37 
38 namespace pgrouting {
39 
40 class CH_vertex {
41  public:
42  int64_t id;
43  CH_vertex() = default;
44  CH_vertex(const CH_vertex &) = default;
45  CH_vertex(const pgr_edge_t &other, bool is_source) :
46  id(is_source? other.source : other.target)
47  {}
48  void cp_members(const CH_vertex &other) {
49  this->id = other.id;
50  }
52  void add_vertex_id(int64_t vid) {m_contracted_vertices += vid;}
55  bool has_contracted_vertices() const;
57  friend std::ostream& operator <<(std::ostream& os, const CH_vertex& v);
58  private:
60 };
61 
62 size_t
63 check_vertices(std::vector < CH_vertex > vertices);
64 
65 #if 0
66 std::vector < CH_vertex >
68  const pgr_edge_t *data_edges, int64_t count);
69 
70 std::vector < CH_vertex >
72  const std::vector < pgr_edge_t > &data_edges);
73 #endif
74 } // namespace pgrouting
75 
76 #endif // INCLUDE_CPP_COMMON_CH_VERTEX_H_
pgrouting::CH_vertex::operator<<
friend std::ostream & operator<<(std::ostream &os, const CH_vertex &v)
Definition: ch_vertex.cpp:60
pgrouting::CH_vertex::cp_members
void cp_members(const CH_vertex &other)
Definition: ch_vertex.h:48
pgrouting::CH_vertex::has_contracted_vertices
bool has_contracted_vertices() const
Definition: ch_vertex.cpp:49
pgr_edge_t
Definition: pgr_edge_t.h:37
pgrouting::check_vertices
size_t check_vertices(std::vector< Basic_vertex > vertices)
Definition: basic_vertex.cpp:42
pgrouting::CH_vertex::CH_vertex
CH_vertex(const pgr_edge_t &other, bool is_source)
Definition: ch_vertex.h:45
pgrouting::CH_vertex
Definition: ch_vertex.h:40
Identifiers::clear
void clear()
Definition: identifiers.hpp:84
pgrouting::CH_vertex::CH_vertex
CH_vertex()=default
pgrouting::CH_vertex::add_contracted_vertex
void add_contracted_vertex(CH_vertex &v)
Definition: ch_vertex.cpp:55
pgrouting::CH_vertex::clear_contracted_vertices
void clear_contracted_vertices()
Definition: ch_vertex.h:56
pgrouting::CH_vertex::add_vertex_id
void add_vertex_id(int64_t vid)
Definition: ch_vertex.h:52
pgrouting::CH_vertex::contracted_vertices
const Identifiers< int64_t > & contracted_vertices() const
Definition: ch_vertex.cpp:39
pgrouting::CH_vertex::id
int64_t id
Definition: ch_vertex.h:42
pgrouting::extract_vertices
std::vector< Basic_vertex > extract_vertices(std::vector< Basic_vertex > vertices, const std::vector< pgr_edge_t > data_edges)
Definition: basic_vertex.cpp:59
pgr_edge_t.h
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56
identifiers.hpp
Identifiers< int64_t >
pgrouting::CH_vertex::m_contracted_vertices
Identifiers< int64_t > m_contracted_vertices
Definition: ch_vertex.h:59