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)
None public
Node()
is_changed()
will return true.
virtual ~Node()
bool link_to(Link* l)
true
if successful, false
if the link is already there. is_changed()
will return true
bool unlink_to(Link* l)
true
if successful, false
if the link was not there. is_changed()
will return true
bool link_from(Link *l)
true
if successful, false
if the link is already there. is_changed()
will return true
bool unlink_from(Link *l)
true
if successful, false
if the link was not there. is_changed()
will return true
bool is_changed()
true
if something has changed after the last call to set_changed(false)
virtual void set_changed(bool s=true)
virtual
because derivate classes (namely, Neuron) will add functionality.
const std::set<Link*> &next()
const std::set<Link*> &prev()
virtual ostream &writeTo(ostream &o)
istream &readFrom(istream &i)
static istream& dummyRead(istream &i)