class Node

This class implements a generic node in a graph: it holds two sets of links, inward and outward, it can remember if something has changed, and it has functions to write and read itself to and from streams (which do nothing, since this node has no data other than the two sets of pointers, and those are taken care of by the Graph class)

Attributes:

None public

Methods:

Node()
default constructor: no links known, and is_changed() will return true.
virtual ~Node()
destructor: placeholder for derivate classes
bool link_to(Link* l)
adds a link to the outward links set, return true if successful, false if the link is already there. is_changed() will return true
bool unlink_to(Link* l)
removes a link from the outward links set, return true if successful, false if the link was not there. is_changed() will return true
bool link_from(Link *l)
adds a link to the inward links set, return true if successful, false if the link is already there. is_changed() will return true
bool unlink_from(Link *l)
removes a link from the inward links set, return true if successful, false if the link was not there. is_changed() will return true
bool is_changed()
returns true if something has changed after the last call to set_changed(false)
virtual void set_changed(bool s=true)
sets the changed status of this node. It's virtual because derivate classes (namely, Neuron) will add functionality.
const std::set<Link*> &next()
returns a reference to the outward links set. Maily to use iterators.
const std::set<Link*> &prev()
returns a reference to the inward links set. Maily to use iterators.
virtual ostream &writeTo(ostream &o)
writes nothing to the given stream. Redefined in derivate classes.
istream &readFrom(istream &i)
reads nothing from the given stream. Redefined in derivate classes.
static istream& dummyRead(istream &i)
reads nothing from the given stream. Redefined in derivate classes.