PGROUTING  2.6-dev
restriction.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File: restriction.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 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 ********************************************************************PGR-GNU*/
25 
26 #ifndef INCLUDE_DIJKSTRATRSP_RESTRICTION_H_
27 #define INCLUDE_DIJKSTRATRSP_RESTRICTION_H_
28 #pragma once
29 
30 #include <sstream>
31 #include <deque>
32 #include <vector>
33 #include <set>
34 #include <limits>
35 
36 #include "c_types/restrict_t.h"
37 
38 class Restriction {
39  private:
40  int64_t m_id;
41  std::vector< int64_t > m_restrict_edges;
42  double m_cost;
43 
44  public:
45  Restriction() = default;
46  explicit Restriction(const Restrict_t &r);
47 
48  int64_t id() const {return m_id;}
49  void id(const int64_t& value) {m_id = value;}
50 
51  double cost() const {return m_cost;}
52  void cost(const double& value) {m_cost = value;}
53 
54  std::vector< int64_t > restrict_edges() const {return m_restrict_edges;}
55 
56  void restrict_edges(const int64_t& value) {
57  m_restrict_edges.push_back(value);
58  }
59 
60  void clear() {
61  m_restrict_edges.clear();
62  }
63 
64  int64_t restriction_size() const {return m_restrict_edges.size();}
65 
66  friend std::ostream& operator << (std::ostream &log,
67  const Restriction &r);
68 };
69 
70 #endif // INCLUDE_DIJKSTRATRSP_RESTRICTION_H_
void clear()
Definition: restriction.h:60
double cost() const
Definition: restriction.h:51
void cost(const double &value)
Definition: restriction.h:52
int64_t restriction_size() const
Definition: restriction.h:64
int64_t m_id
Definition: restriction.h:40
double m_cost
Definition: restriction.h:42
Restriction()=default
std::vector< int64_t > m_restrict_edges
Definition: restriction.h:41
void restrict_edges(const int64_t &value)
Definition: restriction.h:56
int64_t id() const
Definition: restriction.h:48
void id(const int64_t &value)
Definition: restriction.h:49
std::vector< int64_t > restrict_edges() const
Definition: restriction.h:54
friend std::ostream & operator<<(std::ostream &log, const Restriction &r)
Definition: restriction.cpp:43