PGROUTING  3.2
pgrouting::CH_vertex Class Reference

#include "ch_vertex.h"

Collaboration diagram for pgrouting::CH_vertex:

Public Member Functions

 CH_vertex ()=default
 
 CH_vertex (const CH_vertex &)=default
 
 CH_vertex (const pgr_edge_t &other, bool is_source)
 
void add_contracted_vertex (CH_vertex &v)
 
void add_vertex_id (int64_t vid)
 
void clear_contracted_vertices ()
 
Identifiers< int64_t > & contracted_vertices ()
 
const Identifiers< int64_t > & contracted_vertices () const
 
void cp_members (const CH_vertex &other)
 
bool has_contracted_vertices () const
 

Public Attributes

int64_t id
 

Private Attributes

Identifiers< int64_t > m_contracted_vertices
 

Friends

std::ostream & operator<< (std::ostream &os, const CH_vertex &v)
 

Detailed Description

Definition at line 40 of file ch_vertex.h.

Constructor & Destructor Documentation

◆ CH_vertex() [1/3]

pgrouting::CH_vertex::CH_vertex ( )
default

◆ CH_vertex() [2/3]

pgrouting::CH_vertex::CH_vertex ( const CH_vertex )
default

◆ CH_vertex() [3/3]

pgrouting::CH_vertex::CH_vertex ( const pgr_edge_t other,
bool  is_source 
)
inline

Definition at line 45 of file ch_vertex.h.

45  :
46  id(is_source? other.source : other.target)
47  {}

Member Function Documentation

◆ add_contracted_vertex()

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

Definition at line 55 of file ch_vertex.cpp.

55  {
56  m_contracted_vertices += v.id;
57  m_contracted_vertices += v.contracted_vertices();
58 }

References contracted_vertices(), id, and m_contracted_vertices.

◆ add_vertex_id()

void pgrouting::CH_vertex::add_vertex_id ( int64_t  vid)
inline

Definition at line 52 of file ch_vertex.h.

52 {m_contracted_vertices += vid;}

References m_contracted_vertices.

◆ clear_contracted_vertices()

void pgrouting::CH_vertex::clear_contracted_vertices ( )
inline

Definition at line 56 of file ch_vertex.h.

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

◆ contracted_vertices() [1/2]

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

◆ contracted_vertices() [2/2]

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

◆ cp_members()

void pgrouting::CH_vertex::cp_members ( const CH_vertex other)
inline

Definition at line 48 of file ch_vertex.h.

48  {
49  this->id = other.id;
50  }

References id.

◆ has_contracted_vertices()

bool pgrouting::CH_vertex::has_contracted_vertices ( ) const

Definition at line 49 of file ch_vertex.cpp.

49  {
50  if (m_contracted_vertices.size() == 0)
51  return false;
52  return true;
53 }

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

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CH_vertex v 
)
friend

Definition at line 60 of file ch_vertex.cpp.

60  {
61  os << "{id: " << v.id << ",\t"
62  << "contracted vertices: "
63  << v.contracted_vertices()
64  << "}";
65  return os;
66 }

Member Data Documentation

◆ id

int64_t pgrouting::CH_vertex::id

◆ m_contracted_vertices

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

The documentation for this class was generated from the following files:
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
Identifiers::size
size_t size() const
Definition: identifiers.hpp:78
Identifiers::clear
void clear()
Definition: identifiers.hpp:84
pgrouting::CH_vertex::id
int64_t id
Definition: ch_vertex.h:42
pgrouting::CH_vertex::m_contracted_vertices
Identifiers< int64_t > m_contracted_vertices
Definition: ch_vertex.h:59