GNode library (C++)
Loading...
Searching...
No Matches
gnode::Link Struct Reference

Represents a connection between two nodes in a graph. More...

#include <link.hpp>

Public Member Functions

 Link (std::string from, int port_from, std::string to, int port_to)
 Constructs a Link instance.
 
bool operator== (const Link &other_link) const
 Equality operator for Link.
 
void print ()
 Prints the details of the Link.
 

Public Attributes

std::string from
 Identifier of the source node.
 
int port_from
 Port number on the source node.
 
std::string to
 Identifier of the destination node.
 
int port_to
 Port number on the destination node.
 

Detailed Description

Represents a connection between two nodes in a graph.

The Link struct holds the details of a connection between two nodes, including the identifiers of the nodes and the ports involved in the connection. This information is used to define and manage the connections within a graph.

Constructor & Destructor Documentation

◆ Link()

gnode::Link::Link ( std::string  from,
int  port_from,
std::string  to,
int  port_to 
)
inline

Constructs a Link instance.

Parameters
fromIdentifier of the source node.
port_fromPort number on the source node.
toIdentifier of the destination node.
port_toPort number on the destination node.

Member Function Documentation

◆ operator==()

bool gnode::Link::operator== ( const Link other_link) const

Equality operator for Link.

Parameters
other_linkAnother Link instance to compare against.
Returns
true if this Link is equal to other_link, otherwise false.

◆ print()

void gnode::Link::print ( )

Prints the details of the Link.

This function outputs the details of the Link to the standard output.

Member Data Documentation

◆ from

std::string gnode::Link::from

Identifier of the source node.

◆ port_from

int gnode::Link::port_from

Port number on the source node.

◆ port_to

int gnode::Link::port_to

Port number on the destination node.

◆ to

std::string gnode::Link::to

Identifier of the destination node.


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