PGROUTING  2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
base_node.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: base_node.h
4 
5 Copyright (c) 2017 pgRouting developers
6 Mail: project@pgrouting.org
7 
8 ------
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 
24  ********************************************************************PGR-GNU*/
25 
28 #ifndef INCLUDE_VRP_BASE_NODE_H_
29 #define INCLUDE_VRP_BASE_NODE_H_
30 #pragma once
31 
32 #include <iosfwd>
33 #include "cpp_common/identifier.h"
34 
35 #if defined(__MINGW32__) || defined(_MSC_VER)
36 #include <stdint.h>
37 #endif
38 
39 namespace pgrouting {
40 namespace vrp {
41 
47 class Base_node : public Identifier {
48  public:
49  Base_node() = default;
50  Base_node(size_t, int64_t);
51 
52 
56  virtual bool operator ==(const Base_node &rhs) const;
57 
60  friend std::ostream& operator<<(
61  std::ostream &log,
62  const Base_node &node);
63 
67  virtual double distance(const Base_node *node) const = 0;
71  private:
72  virtual void print(std::ostream& os) const;
73 };
74 
75 } // namespace vrp
76 } // namespace pgrouting
77 
78 #endif // INCLUDE_VRP_BASE_NODE_H_
friend std::ostream & operator<<(std::ostream &log, const Base_node &node)
Definition: base_node.cpp:32
virtual void print(std::ostream &os) const
Definition: base_node.cpp:38
The Base_node class defines the operations that can be performed in a 2D node.
Definition: base_node.h:47
virtual bool operator==(const Base_node &rhs) const
Definition: base_node.cpp:48
virtual double distance(const Base_node *node) const =0