|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef YARP_MANAGER_GRAPH
10 #define YARP_MANAGER_GRAPH
44 float weight,
bool _virtual=
false);
45 bool addLink(
const char* szFirst,
const char* szSecond,
46 float weight,
bool _virtual=
false);
48 bool removeLink(
const char* szFirst,
const char* szSecond);
53 bool hasNode(
const char* szLabel);
69 class GraphIterator:
public std::iterator<std::input_iterator_tag, Node*>
86 #define PRINT_GRAPH(g)\
87 cout<<"Graph "<<#g<<" with "<<g.getSize()<<" nodes:"<<endl;\
89 for(GraphIterator itr=g.begin(); itr!=g.end(); itr++)\
92 cout<<" "<<n->getLabel()<<": [";\
93 for(int j=0; j<n->sucCount(); j++)\
95 Link l = n->getLinkAt(j);\
96 cout<<l.to()->getLabel()<<"("<<l.weight()<<"), ";\
113 #endif // __YARP_MANAGER_GRAPH__
Node * getNode(const char *szLabel)
GraphIterator & operator++()
bool operator==(const GraphIterator &rhs) const
bool removeLink(Node *first, Node *second)
void setVisited(bool vis)
virtual ~GraphIterator()=default
bool removeNode(Node *node)
bool operator!=(const GraphIterator &rhs) const
Node * getNodeAt(int index)
The main, catch-all namespace for YARP.
std::map< std::string, Node * >::iterator NodePIterator
GraphIterator operator++(int)
std::map< std::string, Node * > NodePContainer
Node * addNode(Node *node)
void setSatisfied(bool sat)
bool addLink(Node *first, Node *second, float weight, bool _virtual=false)