libsemigroups  v3.0.0
C++ library for semigroups and monoids
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Loading...
Searching...
No Matches
Dot::Node

Defined in dot.hpp.

This nested struct represents a node in the represented graph.

Public Member Functions

 Node ()=default
 Default constructor.
 
 Node (Node &&)=default
 Default move constructor.
 
 Node (Node const &)=default
 Default copy constructor.
 
template<typename Thing>
 Node (Thing &&thing)
 Construct from anything.
 
template<typename Thing1, typename Thing2>
Nodeadd_attr (Thing1 &&key, Thing2 &&val)
 Add an attribute to a node.
 
Nodeoperator= (Node &&)=default
 Default move assignment.
 
Nodeoperator= (Node const &)=default
 Default copy assignment.
 

Related Symbols

(Note that these are not member symbols.)

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

Constructor & Destructor Documentation

◆ Node()

template<typename Thing>
Node ( Thing && thing)
inlineexplicit

This constructor creates a new Node object from the parameter thing, which is converted to a string (using std::to_string if thing is not already a std::string) by the constructor.

The newly constructed Node has no attributes set.

Template Parameters
Thingthe type of the argument.
Parameters
thingthe object whose string representation will be the name of the node.

Member Function Documentation

◆ add_attr()

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

This function adds a new attribute, or replaces the value of an existing attribute of a Node. 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::Node const & n)
related

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

Parameters
nthe Dot::Node object.
Exceptions
This function guarantees not to throw a LibsemigroupsException.

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