Jlm
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::util::graph::Edge Class Reference

#include <GraphWriter.hpp>

Inheritance diagram for jlm::util::graph::Edge:
Inheritance graph
[legend]
Collaboration diagram for jlm::util::graph::Edge:
Collaboration graph
[legend]

Classes

struct  Style
 

Public Member Functions

 ~Edge () override=default
 
const char * GetIdPrefix () const override
 
GraphGetGraph () override
 
PortGetFrom ()
 
PortGetTo ()
 
bool IsDirected () const
 
PortGetOtherEnd (const Port &end)
 
void SetStyle (std::string style)
 
void SetArrowHead (std::string arrow)
 
void SetArrowTail (std::string arrow)
 
void OutputDot (std::ostream &out, size_t indent) const
 
- Public Member Functions inherited from jlm::util::graph::GraphElement
virtual ~GraphElement ()=default
 
 GraphElement ()
 
 GraphElement (const GraphElement &other)=delete
 
 GraphElement (GraphElement &&other)=delete
 
GraphElementoperator= (const GraphElement &other)=delete
 
GraphElementoperator= (GraphElement &&other)=delete
 
std::string GetFullId () const
 
const GraphGetGraph () const
 
void SetLabel (std::string label)
 
void AppendToLabel (std::string_view text, std::string_view sep="\n")
 
bool HasLabel () const
 
const std::string & GetLabel () const
 
std::string_view GetLabelOr (std::string_view otherwise) const
 
size_t GetUniqueIdSuffix () const
 
template<typename T >
void SetProgramObject (const T &object)
 
void RemoveProgramObject ()
 
bool HasProgramObject () const noexcept
 
uintptr_t GetProgramObject () const noexcept
 
void SetAttribute (const std::string &attribute, std::string value)
 
void SetAttributeObject (const std::string &attribute, uintptr_t object)
 
template<typename T >
void SetAttributeObject (const std::string &attribute, const T &object)
 
void SetAttributeGraphElement (const std::string &attribute, const GraphElement &element)
 
bool HasAttribute (const std::string &attribute) const
 
std::optional< std::string_view > GetAttributeString (const std::string &attribute) const
 
std::optional< uintptr_t > GetAttributeObject (const std::string &attribute) const
 
const GraphElementGetAttributeGraphElement (const std::string &attribute) const
 
bool RemoveAttribute (const std::string &attribute)
 
virtual void Finalize ()
 
bool IsFinalized () const
 
void OutputAttributes (std::ostream &out, AttributeOutputFormat format) const
 

Private Member Functions

 Edge (Port &from, Port &to, bool directed)
 

Private Attributes

friend Graph
 
PortFrom_
 
PortTo_
 
bool Directed_
 

Detailed Description

Definition at line 676 of file GraphWriter.hpp.

Constructor & Destructor Documentation

◆ Edge()

jlm::util::graph::Edge::Edge ( Port from,
Port to,
bool  directed 
)
private

Definition at line 991 of file GraphWriter.cpp.

◆ ~Edge()

jlm::util::graph::Edge::~Edge ( )
overridedefault

Member Function Documentation

◆ GetFrom()

Port & jlm::util::graph::Edge::GetFrom ( )

Gets the port being pointed to Even if the edge is non-directed, the from/to order can matter for layout.

Definition at line 1014 of file GraphWriter.cpp.

◆ GetGraph()

Graph & jlm::util::graph::Edge::GetGraph ( )
overridevirtual

Gets a reference to the graph this GraphElement belongs to

Implements jlm::util::graph::GraphElement.

Definition at line 1007 of file GraphWriter.cpp.

◆ GetIdPrefix()

const char * jlm::util::graph::Edge::GetIdPrefix ( ) const
overridevirtual

Gets a short string that will serve as the base for a unique ID. This base should be a valid C-like identifier.

Returns
a string, such as "node", "i", "o", "graph"

Implements jlm::util::graph::GraphElement.

Definition at line 1001 of file GraphWriter.cpp.

◆ GetOtherEnd()

Port & jlm::util::graph::Edge::GetOtherEnd ( const Port end)

Given one end of the edge, returns the port on the opposite side of the edge.

Definition at line 1032 of file GraphWriter.cpp.

◆ GetTo()

Port & jlm::util::graph::Edge::GetTo ( )

Gets the port being pointed from. Even if the edge is non-directed, the from/to order can matter for layout.

Definition at line 1020 of file GraphWriter.cpp.

◆ IsDirected()

bool jlm::util::graph::Edge::IsDirected ( ) const
Returns
true if this edge is directed, false otherwise

Definition at line 1026 of file GraphWriter.cpp.

◆ OutputDot()

void jlm::util::graph::Edge::OutputDot ( std::ostream &  out,
size_t  indent 
) const

Outputs the edge in dot format. In ASCII, edges are not implicitly encoded by nodes/ports.

Definition at line 1062 of file GraphWriter.cpp.

◆ SetArrowHead()

void jlm::util::graph::Edge::SetArrowHead ( std::string  arrow)

Customizes the look of the edge at the head end. For a normal arrow, use "normal". Other common options are "box", "diamond" and "dot". Prefix the string with "o" to get outline only. Prefix with "l" or "r" to only get one half. Concatenate multiple strings to get longer arrows, with the tipmost arrow listed first. For full a description of the grammar, see https://graphviz.org/doc/info/arrows.html

Parameters
arrowa string describing the look of the edge head.

Definition at line 1049 of file GraphWriter.cpp.

◆ SetArrowTail()

void jlm::util::graph::Edge::SetArrowTail ( std::string  arrow)

Customizes the look of the edge at the tail end.

Parameters
arrowa string describing the look of the edge tail.
See also
Edge::SetArrowHead() for a short description of the grammar

Definition at line 1055 of file GraphWriter.cpp.

◆ SetStyle()

void jlm::util::graph::Edge::SetStyle ( std::string  style)

Sets the style of the edge

See also
Edge::Style for a list of possible styles

Definition at line 1043 of file GraphWriter.cpp.

Member Data Documentation

◆ Directed_

bool jlm::util::graph::Edge::Directed_
private

Definition at line 765 of file GraphWriter.hpp.

◆ From_

Port& jlm::util::graph::Edge::From_
private

Definition at line 763 of file GraphWriter.hpp.

◆ Graph

friend jlm::util::graph::Edge::Graph
private

Definition at line 678 of file GraphWriter.hpp.

◆ To_

Port& jlm::util::graph::Edge::To_
private

Definition at line 764 of file GraphWriter.hpp.


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