6#ifndef YARP_MANAGER_GRAPH
7#define YARP_MANAGER_GRAPH
40 float weight,
bool _virtual=
false);
41 bool addLink(
const char* szFirst,
const char* szSecond,
42 float weight,
bool _virtual=
false);
44 bool removeLink(
const char* szFirst,
const char* szSecond);
49 bool hasNode(
const char* szLabel);
65class GraphIterator:
public std::iterator<std::input_iterator_tag, Node*>
82#define PRINT_GRAPH(g)\
83 cout<<"Graph "<<#g<<" with "<<g.getSize()<<" nodes:"<<endl;\
85 for(GraphIterator itr=g.begin(); itr!=g.end(); itr++)\
88 cout<<" "<<n->getLabel()<<": [";\
89 for(int j=0; j<n->sucCount(); j++)\
91 Link l = n->getLinkAt(j);\
92 cout<<l.to()->getLabel()<<"("<<l.weight()<<"), ";\
GraphIterator operator++(int)
virtual ~GraphIterator()=default
GraphIterator & operator++()
bool operator!=(const GraphIterator &rhs) const
bool operator==(const GraphIterator &rhs) const
Node * addNode(Node *node)
bool removeNode(Node *node)
Node * getNode(const char *szLabel)
bool removeLink(Node *first, Node *second)
bool addLink(Node *first, Node *second, float weight, bool _virtual=false)
Node * getNodeAt(int index)
void setVisited(bool vis)
void setSatisfied(bool sat)
std::map< std::string, Node * > NodePContainer
std::map< std::string, Node * >::iterator NodePIterator