PGROUTING  3.1
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 ()
 
const Identifiers< int64_t > & contracted_vertices () const
 
Identifiers< int64_t > & contracted_vertices ()
 
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.

References add_contracted_edge_vertices(), add_contracted_vertex(), cp_members(), and has_contracted_vertices().

45  :
46  id(eid), source(source),
47  target(target), cost(cost) {}
int64_t target
Definition: ch_edge.h:64
int64_t source
Definition: ch_edge.h:63

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.

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

Referenced by CH_edge().

67  {
68  if (e.has_contracted_vertices())
69  m_contracted_vertices += e.contracted_vertices();
70 }
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:68

◆ add_contracted_vertex()

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

Definition at line 61 of file ch_edge.cpp.

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

Referenced by CH_edge().

61  {
62  m_contracted_vertices += v.id;
63  m_contracted_vertices += v.contracted_vertices();
64 }
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:68

◆ clear_contracted_vertices()

void pgrouting::CH_edge::clear_contracted_vertices ( )
inline

Definition at line 56 of file ch_edge.h.

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

void clear()
Definition: identifiers.hpp:84
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:68

◆ contracted_vertices() [1/2]

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

◆ contracted_vertices() [2/2]

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

Definition at line 55 of file ch_edge.cpp.

References m_contracted_vertices.

55  {
56  return m_contracted_vertices;
57 }
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:68

◆ cp_members()

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

Definition at line 35 of file ch_edge.cpp.

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

Referenced by CH_edge().

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 }
int64_t target
Definition: ch_edge.h:64
int64_t source
Definition: ch_edge.h:63
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:68

◆ has_contracted_vertices()

bool pgrouting::CH_edge::has_contracted_vertices ( ) const

Definition at line 45 of file ch_edge.cpp.

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

Referenced by add_contracted_edge_vertices(), and CH_edge().

45  {
46  return !m_contracted_vertices.empty();
47 }
bool empty() const
Definition: identifiers.hpp:79
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:68

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.

Referenced by clear_contracted_vertices().

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

◆ 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: