PGROUTING  2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pgrouting::vrp::Base_node Class Referenceabstract

The Base_node class defines the operations that can be performed in a 2D node. More...

#include "base_node.h"

Inheritance diagram for pgrouting::vrp::Base_node:
Collaboration diagram for pgrouting::vrp::Base_node:

Public Member Functions

 Base_node ()=default
 
 Base_node (size_t, int64_t)
 
int64_t id () const
 
size_t idx () const
 
void reset_id (int64_t)
 
to be or not to be
virtual bool operator== (const Base_node &rhs) const
 
distance
virtual double distance (const Base_node *node) const =0
 

Private Member Functions

virtual void print (std::ostream &os) const
 

Friends

std::ostream & operator<< (std::ostream &log, const Base_node &node)
 

Detailed Description

The Base_node class defines the operations that can be performed in a 2D node.

A Base_node is an identifier of a Node or Dnode.

Definition at line 47 of file base_node.h.

Constructor & Destructor Documentation

pgrouting::vrp::Base_node::Base_node ( )
default
pgrouting::vrp::Base_node::Base_node ( size_t  _idx,
int64_t  _id 
)

Definition at line 43 of file base_node.cpp.

44  : Identifier(_idx, _id) {
45  }

Member Function Documentation

virtual double pgrouting::vrp::Base_node::distance ( const Base_node node) const
pure virtual
bool pgrouting::vrp::Base_node::operator== ( const Base_node rhs) const
virtual

Definition at line 48 of file base_node.cpp.

References pgrouting::Identifier::id(), and pgrouting::Identifier::idx().

48  {
49  if (&rhs == this) return true;
50  return
51  (idx() == rhs.idx())
52  && (id() == rhs.id());
53 }
size_t idx() const
Definition: identifier.cpp:37

Here is the call graph for this function:

void pgrouting::vrp::Base_node::print ( std::ostream &  os) const
privatevirtual

Reimplemented in pgrouting::vrp::Node.

Definition at line 38 of file base_node.cpp.

References pgrouting::Identifier::id(), and pgrouting::Identifier::idx().

Referenced by pgrouting::vrp::operator<<().

38  {
39  os << id()
40  << "(" << idx() << ")";
41 }
int64_t id() const
Definition: identifier.cpp:42
size_t idx() const
Definition: identifier.cpp:37

Here is the call graph for this function:

Here is the caller graph for this function:

void pgrouting::Identifier::reset_id ( int64_t  _id)
inherited

Definition at line 47 of file identifier.cpp.

References pgrouting::Identifier::m_id.

Referenced by pgrouting::vrp::Tw_node::Tw_node().

47  {
48  m_id = _id;
49 }

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  log,
const Base_node node 
)
friend

Definition at line 32 of file base_node.cpp.

32  {
33  node.print(log);
34  return log;
35 }

The documentation for this class was generated from the following files: