PGROUTING  3.2
pgrouting::trsp::EdgeInfo Class Reference

#include "edgeInfo.h"

Collaboration diagram for pgrouting::trsp::EdgeInfo:

Public Member Functions

 EdgeInfo ()=default
 
 EdgeInfo (pgr_edge_t edgeIn, size_t edgeIndex)
 
void connect_endEdge (size_t edge_idx)
 
void connect_startEdge (size_t edge_idx)
 
double cost () const
 
int64_t edgeID () const
 
std::vector< size_t > endConnectedEdge () const
 
int64_t endNode () const
 
double get_cost (int64_t node) const
 
std::vector< size_t > get_idx (bool isStart) const
 
size_t idx () const
 
double r_cost () const
 
std::vector< size_t > startConnectedEdge () const
 
int64_t startNode () const
 

Private Attributes

pgr_edge_t m_edge
 
size_t m_edgeIndex
 
std::vector< size_t > m_endConnectedEdge
 
std::vector< size_t > m_startConnectedEdge
 

Detailed Description

Definition at line 39 of file edgeInfo.h.

Constructor & Destructor Documentation

◆ EdgeInfo() [1/2]

pgrouting::trsp::EdgeInfo::EdgeInfo ( )
default

◆ EdgeInfo() [2/2]

pgrouting::trsp::EdgeInfo::EdgeInfo ( pgr_edge_t  edgeIn,
size_t  edgeIndex 
)

Definition at line 32 of file edgeInfo.cpp.

34  :
35  m_edge(edgeIn),
36  m_edgeIndex(edgeIndex),
39 
40  {}

Member Function Documentation

◆ connect_endEdge()

void pgrouting::trsp::EdgeInfo::connect_endEdge ( size_t  edge_idx)
inline

Definition at line 67 of file edgeInfo.h.

67  {
68  m_endConnectedEdge.push_back(edge_idx);
69  }

References m_endConnectedEdge.

Referenced by pgrouting::trsp::Pgr_trspHandler::connectEndEdge(), and pgrouting::trsp::Pgr_trspHandler::connectStartEdge().

◆ connect_startEdge()

void pgrouting::trsp::EdgeInfo::connect_startEdge ( size_t  edge_idx)
inline

Definition at line 70 of file edgeInfo.h.

70  {
71  m_startConnectedEdge.push_back(edge_idx);
72  }

References m_startConnectedEdge.

Referenced by pgrouting::trsp::Pgr_trspHandler::connectEndEdge(), and pgrouting::trsp::Pgr_trspHandler::connectStartEdge().

◆ cost()

◆ edgeID()

int64_t pgrouting::trsp::EdgeInfo::edgeID ( ) const
inline

Definition at line 57 of file edgeInfo.h.

57 {return m_edge.id;}

References pgr_edge_t::id, and m_edge.

◆ endConnectedEdge()

std::vector<size_t> pgrouting::trsp::EdgeInfo::endConnectedEdge ( ) const
inline

Definition at line 74 of file edgeInfo.h.

74  {
75  return m_endConnectedEdge;
76  }

References m_endConnectedEdge.

Referenced by get_idx().

◆ endNode()

◆ get_cost()

double pgrouting::trsp::EdgeInfo::get_cost ( int64_t  node) const
inline

Definition at line 60 of file edgeInfo.h.

60  {
61  pgassert(node == startNode() || node == endNode());
62  return node == startNode() ?
63  cost() :
64  r_cost();
65  }

References cost(), endNode(), pgassert, r_cost(), and startNode().

◆ get_idx()

std::vector<size_t> pgrouting::trsp::EdgeInfo::get_idx ( bool  isStart) const
inline

Definition at line 82 of file edgeInfo.h.

82  {
83  return isStart ?
86  }

References endConnectedEdge(), and startConnectedEdge().

Referenced by pgrouting::trsp::Pgr_trspHandler::explore().

◆ idx()

size_t pgrouting::trsp::EdgeInfo::idx ( ) const
inline

◆ r_cost()

◆ startConnectedEdge()

std::vector<size_t> pgrouting::trsp::EdgeInfo::startConnectedEdge ( ) const
inline

Definition at line 78 of file edgeInfo.h.

78  {
79  return m_startConnectedEdge;
80  }

References m_startConnectedEdge.

Referenced by get_idx().

◆ startNode()

Member Data Documentation

◆ m_edge

pgr_edge_t pgrouting::trsp::EdgeInfo::m_edge
private

Definition at line 90 of file edgeInfo.h.

Referenced by cost(), edgeID(), endNode(), r_cost(), and startNode().

◆ m_edgeIndex

size_t pgrouting::trsp::EdgeInfo::m_edgeIndex
private

Definition at line 91 of file edgeInfo.h.

Referenced by idx().

◆ m_endConnectedEdge

std::vector<size_t> pgrouting::trsp::EdgeInfo::m_endConnectedEdge
private

Definition at line 93 of file edgeInfo.h.

Referenced by connect_endEdge(), and endConnectedEdge().

◆ m_startConnectedEdge

std::vector<size_t> pgrouting::trsp::EdgeInfo::m_startConnectedEdge
private

Definition at line 92 of file edgeInfo.h.

Referenced by connect_startEdge(), and startConnectedEdge().


The documentation for this class was generated from the following files:
pgr_edge_t::cost
double cost
Definition: pgr_edge_t.h:41
pgrouting::trsp::EdgeInfo::startConnectedEdge
std::vector< size_t > startConnectedEdge() const
Definition: edgeInfo.h:78
pgr_edge_t::source
int64_t source
Definition: pgr_edge_t.h:39
pgr_edge_t::target
int64_t target
Definition: pgr_edge_t.h:40
pgassert
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:94
pgrouting::trsp::EdgeInfo::m_endConnectedEdge
std::vector< size_t > m_endConnectedEdge
Definition: edgeInfo.h:93
pgrouting::trsp::EdgeInfo::r_cost
double r_cost() const
Definition: edgeInfo.h:59
pgr_edge_t::reverse_cost
double reverse_cost
Definition: pgr_edge_t.h:42
pgrouting::trsp::EdgeInfo::m_edgeIndex
size_t m_edgeIndex
Definition: edgeInfo.h:91
pgrouting::trsp::EdgeInfo::m_startConnectedEdge
std::vector< size_t > m_startConnectedEdge
Definition: edgeInfo.h:92
pgrouting::trsp::EdgeInfo::endNode
int64_t endNode() const
Definition: edgeInfo.h:53
pgrouting::trsp::EdgeInfo::m_edge
pgr_edge_t m_edge
Definition: edgeInfo.h:90
pgrouting::trsp::EdgeInfo::endConnectedEdge
std::vector< size_t > endConnectedEdge() const
Definition: edgeInfo.h:74
pgr_edge_t::id
int64_t id
Definition: pgr_edge_t.h:38
pgrouting::trsp::EdgeInfo::cost
double cost() const
Definition: edgeInfo.h:58
pgrouting::trsp::EdgeInfo::startNode
int64_t startNode() const
Definition: edgeInfo.h:49