vrpRouting  0.3
identifier.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2  *
3 
4 Copyright (c) 2017 Celia Virginia Vergara Castillo
6 
7 ------
8 
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 
23  ********************************************************************PGR-GNU*/
24 
29 #ifndef INCLUDE_CPP_COMMON_IDENTIFIER_H_
30 #define INCLUDE_CPP_COMMON_IDENTIFIER_H_
31 #pragma once
32 
33 #if defined(__MINGW32__) || defined(_MSC_VER)
34 #include <stdint.h>
35 #endif
36 
37 #include <ostream>
38 
39 namespace vrprouting {
40 
65 class Identifier {
66  public:
67  Identifier() = default;
68  Identifier(const Identifier &v) = default;
69  Identifier(size_t _idx, int64_t _id);
70 
75  int64_t id() const;
77  size_t idx() const;
79  void reset_id(int64_t);
83  friend std::ostream& operator<<(std::ostream& log, const Identifier&);
84 
85  private:
86  size_t m_idx;
87  int64_t m_id;
88 };
89 
90 
91 } // namespace vrprouting
92 
93 #endif // INCLUDE_CPP_COMMON_IDENTIFIER_H_
vrprouting::Identifier::Identifier
Identifier()=default
vrprouting::Identifier::id
int64_t id() const
get the original id
Definition: identifier.cpp:42
vrprouting::Identifier::m_id
int64_t m_id
Definition: identifier.h:87
vrprouting::Identifier::m_idx
size_t m_idx
Definition: identifier.h:86
vrprouting::Identifier::idx
size_t idx() const
get the internal index
Definition: identifier.cpp:37
vrprouting::Identifier::operator<<
friend std::ostream & operator<<(std::ostream &log, const Identifier &)
print the Identifier information
Definition: identifier.cpp:51
vrprouting::Identifier
Class that stores the information about identifiers.
Definition: identifier.h:65
vrprouting::Identifier::reset_id
void reset_id(int64_t)
change the original id
Definition: identifier.cpp:47
vrprouting
Definition: base_matrix.cpp:46