21 #include <unordered_map> 23 #include "attributes.h" 29 using NodePtr = std::shared_ptr<BaseNode>;
39 friend class TestNodes;
51 Node(
const std::pair<const int, Node>& p);
56 Node(
const std::pair<const int, Edge>& p);
81 NodePtr
clone()
const;
A class for variant data types (tagged union).
Definition: value.h:56
const Edges & outEdges() const
Gets the edges leaving the node.
void setX(float x)
Sets the node's x coordinate.
It wraps a std::shared_ptr<BaseNode>.
Definition: node.h:35
A collection of utility functions for creating and saving nodes.
Definition: nodes_p.h:32
const Value & attr(int id) const
Gets the value of the attribute at id.
float y() const
Gets the node's y coordinate.
Node randNeighbour(PRG *prg) const
Gets a random neighbour.
void setY(float y)
Sets the node's y coordinate.
float x() const
Gets the node's x coordinate.
const Attributes & attrs() const
Gets all the node's Attributes.
bool isNull() const
Checks if the current Node is null.
bool operator==(const Node &n) const
Checks if n and the current Node point to the same BaseNode.
const Edges & inEdges() const
Gets the edges entering the node.
int degree() const
Gets the node's degree.
NodePtr clone() const
Creates a new std::shared_ptr<BaseNode> with the same data of the current Node.
int outDegree() const
Gets the node's out-degree, i.e., the number of edges leaving the node.
void setCoords(float x, float y)
Sets the node's coordinates.
Node & operator=(const Node &n)
Sets the current node to n.
Pseudo-random number generator.
Definition: prg.h:29
int inDegree() const
Gets the node's in-degree, i.e., the number of edges entering the node.
void setAttr(const int id, const Value &value)
Sets the value at id.
bool operator!=(const Node &n) const
Checks if n and the current Node point to the same BaseNode.
Definition: abstractgraph.h:29
A container of labeled values.
Definition: attributes.h:39
Abstract base class for graph plugins.
Definition: abstractgraph.h:54
int id() const
Gets the node's id.
An Edge container.
Definition: edges.h:32