PGROUTING  3.2
pgrouting::CH_edge Class Reference

#include "ch_edge.h"

Collaboration diagram for pgrouting::CH_edge:

Public Member Functions

 CH_edge ()=default
 
 CH_edge (int64_t eid, int64_t source, int64_t target, double cost)
 
void add_contracted_edge_vertices (CH_edge &e)
 
void add_contracted_vertex (CH_vertex &v)
 
void clear_contracted_vertices ()
 
Identifiers< int64_t > & contracted_vertices ()
 
const Identifiers< int64_t > & contracted_vertices () const
 
void cp_members (const CH_edge &other)
 
bool has_contracted_vertices () const
 

Public Attributes

double cost
 
int64_t id
 
int64_t source
 
int64_t target
 

Private Attributes

Identifiers< int64_t > m_contracted_vertices
 

Friends

std::ostream & operator<< (std::ostream &os, const CH_edge &e)
 

Detailed Description

Definition at line 41 of file ch_edge.h.

Constructor & Destructor Documentation

◆ CH_edge() [1/2]

pgrouting::CH_edge::CH_edge ( )
default

◆ CH_edge() [2/2]

pgrouting::CH_edge::CH_edge ( int64_t  eid,
int64_t  source,
int64_t  target,
double  cost 
)
inline

Definition at line 45 of file ch_edge.h.

45  :
46  id(eid), source(source),
47  target(target), cost(cost) {}

Member Function Documentation

◆ add_contracted_edge_vertices()

void pgrouting::CH_edge::add_contracted_edge_vertices ( CH_edge e)

Definition at line 67 of file ch_edge.cpp.

67  {
68  if (e.has_contracted_vertices())
69  m_contracted_vertices += e.contracted_vertices();
70 }

References contracted_vertices(), has_contracted_vertices(), and m_contracted_vertices.

◆ add_contracted_vertex()

void pgrouting::CH_edge::add_contracted_vertex ( CH_vertex v)

Definition at line 61 of file ch_edge.cpp.

61  {
62  m_contracted_vertices += v.id;
63  m_contracted_vertices += v.contracted_vertices();
64 }

References pgrouting::CH_vertex::contracted_vertices(), pgrouting::CH_vertex::id, and m_contracted_vertices.

◆ clear_contracted_vertices()

void pgrouting::CH_edge::clear_contracted_vertices ( )
inline

Definition at line 56 of file ch_edge.h.

References Identifiers< T >::clear(), and m_contracted_vertices.

◆ contracted_vertices() [1/2]

Identifiers<int64_t>& pgrouting::CH_edge::contracted_vertices ( )

◆ contracted_vertices() [2/2]

Identifiers< int64_t > & pgrouting::CH_edge::contracted_vertices ( ) const

◆ cp_members()

void pgrouting::CH_edge::cp_members ( const CH_edge other)

Definition at line 35 of file ch_edge.cpp.

35  {
36  this->cost = other.cost;
37  this->id = other.id;
38  this->source = other.source;
39  this->target = other.target;
40  this->m_contracted_vertices += other.contracted_vertices();
41 }

References contracted_vertices(), cost, id, m_contracted_vertices, source, and target.

◆ has_contracted_vertices()

bool pgrouting::CH_edge::has_contracted_vertices ( ) const

Definition at line 45 of file ch_edge.cpp.

45  {
46  return !m_contracted_vertices.empty();
47 }

References Identifiers< T >::empty(), and m_contracted_vertices.

Referenced by add_contracted_edge_vertices().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CH_edge e 
)
friend

Definition at line 72 of file ch_edge.cpp.

72  {
73  os << "{id: " << e.id << ",\t"
74  << "source: " << e.source << ",\t"
75  << "target: " << e.target << ",\t"
76  << "cost: " << e.cost << ",\t"
77  << "contracted vertices: "
78  << e.contracted_vertices()
79  << "}";
80  return os;
81 }

Member Data Documentation

◆ cost

double pgrouting::CH_edge::cost

Definition at line 65 of file ch_edge.h.

Referenced by cp_members(), and pgrouting::operator<<().

◆ id

int64_t pgrouting::CH_edge::id

Definition at line 62 of file ch_edge.h.

Referenced by cp_members(), and pgrouting::operator<<().

◆ m_contracted_vertices

Identifiers<int64_t> pgrouting::CH_edge::m_contracted_vertices
private

◆ source

int64_t pgrouting::CH_edge::source

Definition at line 63 of file ch_edge.h.

Referenced by cp_members(), and pgrouting::operator<<().

◆ target

int64_t pgrouting::CH_edge::target

Definition at line 64 of file ch_edge.h.

Referenced by cp_members(), and pgrouting::operator<<().


The documentation for this class was generated from the following files:
pgrouting::CH_edge::id
int64_t id
Definition: ch_edge.h:62
pgrouting::CH_edge::cost
double cost
Definition: ch_edge.h:65
Identifiers::clear
void clear()
Definition: identifiers.hpp:84
Identifiers::empty
bool empty() const
Definition: identifiers.hpp:79
pgrouting::CH_edge::target
int64_t target
Definition: ch_edge.h:64
pgrouting::CH_edge::source
int64_t source
Definition: ch_edge.h:63
pgrouting::CH_edge::m_contracted_vertices
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:68