PGROUTING  2.5
line_vertex.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File: line_vertex.h
3 
4 Generated with Template by:
5 Copyright (c) 2015 pgRouting developers
6 Mail: project@pgrouting.org
7 
8 Function's developer:
9 Copyright (c) 2017 Vidhan Jain
10 Mail: vidhanj1307@gmail.com
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 
32 #ifndef INCLUDE_CPP_COMMON_LINE_VERTEX_H_
33 #define INCLUDE_CPP_COMMON_LINE_VERTEX_H_
34 #pragma once
35 
36 #include <vector>
37 #include <ostream>
38 
39 #include "c_types/pgr_edge_t.h"
40 
41 
42 
43 namespace pgrouting {
44 
45 class Line_vertex {
46  public:
48  id(0) {}
49 
51  id(edge.id),
52  vertex_id(edge.id),
53  source(edge.source),
54  target(edge.target),
55  cost(edge.cost) {}
56 
58  id(v.id),
60  source(v.source),
61  target(v.target),
62  cost(v.cost) {}
63 
64  void cp_members(const Line_vertex &other) {
65  this->id = other.id;
66  this->vertex_id = other.vertex_id;
67  this->cost = other.cost;
68  this->source = other.source;
69  this->target = other.target;
70  }
71 
72  void cp_members(int64_t _id, int64_t _source) {
73  this->id = _id;
74  this->vertex_id = -1;
75  this->cost = 0;
76  this->source = _source;
77  this->target = -1;
78  }
79 
80  friend std::ostream& operator<<(std::ostream& log, const Line_vertex &v) {
81  log << "\nid = " << v.id;
82  log << " | vertex_id = " << v.vertex_id;
83  log << " | source = " << v.source;
84  log << " | target = " << v.target;
85  log << " | cost = " << v.cost;
86  return log;
87  }
88 
89  public:
90  int64_t id;
91  int64_t vertex_id;
92  int64_t source;
93  int64_t target;
94  double cost;
95 };
96 
97 } // namespace pgrouting
98 
99 #endif // INCLUDE_CPP_COMMON_LINE_VERTEX_H_
Definition: trsp.h:31
Line_vertex(const Line_vertex &v)
Definition: line_vertex.h:57
void cp_members(int64_t _id, int64_t _source)
Definition: line_vertex.h:72
Line_vertex(const pgr_edge_t &edge)
Definition: line_vertex.h:50
friend std::ostream & operator<<(std::ostream &log, const Line_vertex &v)
Definition: line_vertex.h:80
void cp_members(const Line_vertex &other)
Definition: line_vertex.h:64
Book keeping class for swapping orders between vehicles.
Definition: basic_edge.cpp:28