libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
Dot::Edge

Defined in dot.hpp.

This nested struct represents an edge in the represented graph.

Public Member Functions

 Edge ()=default
 Default constructor.
 
 Edge (Edge &&)=default
 Default move constructor.
 
 Edge (Edge const &)=default
 Default copy constructor.
 
template<typename Thing1, typename Thing2>
 Edge (Thing1 &&h, Thing2 &&t)
 Construct from head and tail.
 
template<typename Thing1, typename Thing2>
Edgeadd_attr (Thing1 &&key, Thing2 &&val)
 Add an attribute to an edge.
 
Edgeoperator= (Edge &&)=default
 Default move assignment.
 
Edgeoperator= (Edge const &)=default
 Default copy assignment.
 

Related Symbols

(Note that these are not member symbols.)

std::string to_human_readable_repr (Dot::Edge const &e)
 Return a human readable representation of a Dot::Edge object.
 

Constructor & Destructor Documentation

◆ Edge()

template<typename Thing1, typename Thing2>
Edge ( Thing1 && h,
Thing2 && t )
inline

This constructor creates a new Edge object with head h (converted to a std::string using std::to_string if thing is not already a std::string, std::string_view, or char const*) and tail t (similarly converted to a std::string).

The newly constructed Edge has no attributes set.

Template Parameters
Thingthe type of the argument.
Parameters
hthe head of the edge.
tthe tail of the edge.

Member Function Documentation

◆ add_attr()

template<typename Thing1, typename Thing2>
Edge & add_attr ( Thing1 && key,
Thing2 && val )
inline

This function adds a new attribute, or replaces the value of an existing attribute of an Edge. The arguments key and val are converted to std::string (unless they are std::string, std::string_view, or char const* already).

Template Parameters
Thing1the type of the first argument.
Thing2the type of the second argument.
Parameters
keythe name of the attribute.
valthe value of the attribute.
Returns
A reference to this.
Warning
No checks of any kind are performed that the string representations of key or val are valid in DOT; see the Graphviz documentation for more details.

Friends And Related Symbol Documentation

◆ to_human_readable_repr()

std::string to_human_readable_repr ( Dot::Edge const & e)
related

Return a human readable representation of a Dot::Edge object.

Parameters
ethe Dot::Edge object.
Exceptions
This function guarantees not to throw a LibsemigroupsException.

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