PGROUTING  3.1
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 ()
 
const Identifiers< int64_t > & contracted_vertices () const
 
Identifiers< int64_t > & contracted_vertices ()
 
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  {}
int64_t source
Definition: pgr_edge_t.h:39
int64_t target
Definition: pgr_edge_t.h:40

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.

References contracted_vertices(), id, and m_contracted_vertices.

Referenced by cp_members().

55  {
56  m_contracted_vertices += v.id;
57  m_contracted_vertices += v.contracted_vertices();
58 }
Identifiers< int64_t > m_contracted_vertices
Definition: ch_vertex.h:59

◆ add_vertex_id()

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

Definition at line 52 of file ch_vertex.h.

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

52 {m_contracted_vertices += vid;}
Identifiers< int64_t > m_contracted_vertices
Definition: ch_vertex.h:59

◆ clear_contracted_vertices()

void pgrouting::CH_vertex::clear_contracted_vertices ( )
inline

Definition at line 56 of file ch_vertex.h.

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

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

◆ contracted_vertices() [1/2]

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

Definition at line 39 of file ch_vertex.cpp.

References m_contracted_vertices.

Referenced by pgrouting::CH_edge::add_contracted_vertex(), add_contracted_vertex(), add_vertex_id(), and pgrouting::operator<<().

39  {
40  return m_contracted_vertices;
41 }
Identifiers< int64_t > m_contracted_vertices
Definition: ch_vertex.h:59

◆ contracted_vertices() [2/2]

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

Definition at line 44 of file ch_vertex.cpp.

References m_contracted_vertices.

44  {
45  return m_contracted_vertices;
46 }
Identifiers< int64_t > m_contracted_vertices
Definition: ch_vertex.h:59

◆ cp_members()

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

Definition at line 48 of file ch_vertex.h.

References add_contracted_vertex(), and id.

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

◆ has_contracted_vertices()

bool pgrouting::CH_vertex::has_contracted_vertices ( ) const

Definition at line 49 of file ch_vertex.cpp.

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

Referenced by add_vertex_id().

49  {
50  if (m_contracted_vertices.size() == 0)
51  return false;
52  return true;
53 }
Identifiers< int64_t > m_contracted_vertices
Definition: ch_vertex.h:59
size_t size() const
Definition: identifiers.hpp:78

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.

Referenced by clear_contracted_vertices().

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: