Chi-Tech
chi::DirectedGraph::VertexAccessor Class Reference

#include <chi_directed_graph.h>

Data Structures

class  iterator
 

Public Member Functions

void AddVertex (size_t id, void *context)
 
void AddVertex (void *context)
 
void RemoveVertex (size_t v)
 
GraphVertexoperator[] (size_t v)
 
iterator begin ()
 
iterator end ()
 
size_t size ()
 
size_t GetNumValid ()
 
void clear ()
 

Private Attributes

std::vector< GraphVertexvertices_
 
std::vector< bool > vertex_valid_flags_
 

Detailed Description

Allows semi-sane access to vertices even if they are removed from the graph.

Definition at line 18 of file chi_directed_graph.h.

Member Function Documentation

◆ AddVertex() [1/2]

void chi::DirectedGraph::VertexAccessor::AddVertex ( size_t  id,
void *  context 
)

Adds a vertex to the graph with a supplied id.

Definition at line 12 of file chi_directed_graph.cc.

◆ AddVertex() [2/2]

void chi::DirectedGraph::VertexAccessor::AddVertex ( void *  context)

Adds a vertex to the graph where the ID is assigned to the number of vertices already loaded on the graph. For example, if there are 3 vertices on the graph (with IDs 0 through 2) then the next vertex (this one) will be assigned and ID of 3.

Definition at line 24 of file chi_directed_graph.cc.

◆ begin()

iterator chi::DirectedGraph::VertexAccessor::begin ( )
inline

Definition at line 78 of file chi_directed_graph.h.

◆ clear()

void chi::DirectedGraph::VertexAccessor::clear ( )
inline

Definition at line 106 of file chi_directed_graph.h.

◆ end()

iterator chi::DirectedGraph::VertexAccessor::end ( )
inline

Definition at line 93 of file chi_directed_graph.h.

◆ GetNumValid()

size_t chi::DirectedGraph::VertexAccessor::GetNumValid ( )
inline

Definition at line 97 of file chi_directed_graph.h.

◆ operator[]()

chi::GraphVertex & chi::DirectedGraph::VertexAccessor::operator[] ( size_t  v)

Accesses a vertex from the graph.

Definition at line 65 of file chi_directed_graph.cc.

◆ RemoveVertex()

void chi::DirectedGraph::VertexAccessor::RemoveVertex ( size_t  v)

Removes a vertex from the graph.

Definition at line 34 of file chi_directed_graph.cc.

◆ size()

size_t chi::DirectedGraph::VertexAccessor::size ( )
inline

Definition at line 95 of file chi_directed_graph.h.

Field Documentation

◆ vertex_valid_flags_

std::vector<bool> chi::DirectedGraph::VertexAccessor::vertex_valid_flags_
private

Definition at line 22 of file chi_directed_graph.h.

◆ vertices_

std::vector<GraphVertex> chi::DirectedGraph::VertexAccessor::vertices_
private

Definition at line 21 of file chi_directed_graph.h.


The documentation for this class was generated from the following files: