cgrapht 1.0.0
A modern C++20 header-only graph library
Loading...
Searching...
No Matches
cgrapht::DefaultEdge Struct Reference

A library supplied edge type. More...

#include <default_edge.hpp>

Public Member Functions

 DefaultEdge (const std::size_t id)
 The constructor accepting a stze_t type argument that it uses as hash later.
 
bool operator== (const DefaultEdge &other) const =default
 

Public Attributes

std::size_t id {}
 User passed ID parameter that is used as the hash value.
 

Detailed Description

A library supplied edge type.

This is a library supplied edge type. This takes an id parameter in the constructor and uses that as it's hash value itself. For simple academic cases, this is good enough to be used as is.

Usage:

graph.add_edge(v1_id, v2_id, DefaultEdge{1});
Directed graph with hashed vertex and edge ids.
Definition graph.hpp:63
Result< std::size_t, ErrorType > add_edge(std::size_t from_id, std::size_t to_id, const E &e)
Add a directed edge between two vertices.
Definition graph.hpp:177
A library supplied edge type.

Definition at line 20 of file default_edge.hpp.

Constructor & Destructor Documentation

◆ DefaultEdge()

cgrapht::DefaultEdge::DefaultEdge ( const std::size_t  id)
inlineexplicit

The constructor accepting a stze_t type argument that it uses as hash later.

Parameters
id

Definition at line 31 of file default_edge.hpp.

Member Function Documentation

◆ operator==()

bool cgrapht::DefaultEdge::operator== ( const DefaultEdge other) const
default

Member Data Documentation

◆ id

std::size_t cgrapht::DefaultEdge::id {}

User passed ID parameter that is used as the hash value.

Definition at line 24 of file default_edge.hpp.


The documentation for this struct was generated from the following file: