vrpRouting  0.3
vrprouting::Identifier Class Reference

Class that stores the information about identifiers. More...

#include "identifier.h"

Inheritance diagram for vrprouting::Identifier:

Public Member Functions

 Identifier ()=default
 
 Identifier (const Identifier &v)=default
 
 Identifier (size_t _idx, int64_t _id)
 

Private Attributes

int64_t m_id
 
size_t m_idx
 

Friends

std::ostream & operator<< (std::ostream &log, const Identifier &)
 print the Identifier information More...
 

Detailed Description

Class that stores the information about identifiers.

dot_inline_dotgraph_5.png

Data comes with an identifier

  • does not check for uniquenes of those identifiers
    • it is responsibility of the database mantainers to give unique identifiers

Example use:

struct data_t {
int64_t d_id; // identifier value
// other structure members
}
vector<data_t> foo;
foo.push_back({1234, ... })
Identifier i(0, 1234); // original identifier 1234 is located on position 0 of foo

Definition at line 65 of file identifier.h.

Constructor & Destructor Documentation

◆ Identifier() [1/3]

vrprouting::Identifier::Identifier ( )
default

◆ Identifier() [2/3]

vrprouting::Identifier::Identifier ( const Identifier v)
default

◆ Identifier() [3/3]

vrprouting::Identifier::Identifier ( size_t  _idx,
int64_t  _id 
)

Definition at line 30 of file identifier.cpp.

32  :
33  m_idx(_idx),
34  m_id(_id) {}

Member Function Documentation

◆ id()

◆ idx()

◆ reset_id()

void vrprouting::Identifier::reset_id ( int64_t  _id)

change the original id

Definition at line 47 of file identifier.cpp.

47  {
48  m_id = _id;
49 }

References m_id.

Referenced by vrprouting::problem::Tw_node::Tw_node().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  log,
const Identifier ident 
)
friend

print the Identifier information

Definition at line 51 of file identifier.cpp.

51  {
52  log << "id(idx) = " << ident.id() << "(" << ident.idx() << ")";
53  return log;
54 }

Member Data Documentation

◆ m_id

int64_t vrprouting::Identifier::m_id
private

Definition at line 87 of file identifier.h.

Referenced by id(), and reset_id().

◆ m_idx

size_t vrprouting::Identifier::m_idx
private

Definition at line 86 of file identifier.h.

Referenced by idx().


The documentation for this class was generated from the following files:
vrprouting::Identifier::Identifier
Identifier()=default
vrprouting::Identifier::m_id
int64_t m_id
Definition: identifier.h:87
vrprouting::Identifier::m_idx
size_t m_idx
Definition: identifier.h:86