Evoplex  0.2.1
Classes | Public Member Functions | Friends | List of all members
evoplex::BaseEdge Class Reference

An Edge connects a node to itself or to another node. More...

#include <edge_p.h>

Public Member Functions

 BaseEdge (const constructor_key &, int id, const Node &origin, const Node &neighbour, Attributes *attrs=new Attributes(), bool ownsAttrs=true)
 
const Attributesattrs () const
 Gets the edge's attributes.
 
const Valueattr (int id) const
 Gets the value of the attribute at id. More...
 
Value attr (const QString &name, Value defaultValue=Value()) const
 Gets the value corresponding to name. More...
 
void setAttr (int id, const Value &value)
 Sets the value at id. More...
 
void addAttr (QString name, Value value)
 Appends the attribute name with the value value. More...
 
int id () const
 Gets the edge's id.
 
const Nodeorigin () const
 Gets the source Node.
 
const Nodeneighbour () const
 Gets the target Node.
 

Friends

class AbstractGraph
 
class TestEdge
 

Detailed Description

An Edge connects a node to itself or to another node.

Attention
An edge can only be created by an AbstractGraph derived object.

Member Function Documentation

◆ addAttr()

void evoplex::BaseEdge::addAttr ( QString  name,
Value  value 
)
inline

Appends the attribute name with the value value.

Parameters
nameThe attribute's name.
valueThe attribute's value.

◆ attr() [1/2]

const Value & evoplex::BaseEdge::attr ( int  id) const
inline

Gets the value of the attribute at id.

Parameters
idThe attribute's id.
Exceptions
std::out_of_rangeif the id is not present.

◆ attr() [2/2]

Value evoplex::BaseEdge::attr ( const QString &  name,
Value  defaultValue = Value() 
) const
inline

Gets the value corresponding to name.

Parameters
nameThe attribute's name.
defaultValueA Value to be returned if name is not present.

◆ setAttr()

void evoplex::BaseEdge::setAttr ( int  id,
const Value value 
)
inline

Sets the value at id.

Parameters
idThe attribute's id.
valueThe new attribute's value.
Exceptions
std::out_of_rangeif the id is not present.

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