PGROUTING  2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
identifier.cpp
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 Copyright (c) 2017 Celia Virginia Vergara Castillo
4 vicky_vergara@hotmail.com
5 
6 ------
7 
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 
22 ********************************************************************PGR-GNU*/
23 
24 #include "cpp_common/identifier.h"
25 
26 
27 namespace pgrouting {
28 
29 
31  const size_t _idx,
32  const int64_t _id) :
33  m_idx(_idx),
34  m_id(_id) {}
35 
36 size_t
37 Identifier::idx() const {
38  return m_idx;
39 }
40 
41 int64_t
42 Identifier::id() const {
43  return m_id;
44 }
45 
46 void
47 Identifier::reset_id(int64_t _id) {
48  m_id = _id;
49 }
50 
51 std::ostream& operator<<(std::ostream& log, const Identifier &ident) {
52  log << "id(idx) = " << ident.id() << "(" << ident.idx() << ")";
53  return log;
54 }
55 
56 } // namespace pgrouting
std::ostream & operator<<(std::ostream &log, const Basic_vertex &v)
int64_t id() const
Definition: identifier.cpp:42
void reset_id(int64_t)
Definition: identifier.cpp:47
size_t idx() const
Definition: identifier.cpp:37