本文整理汇总了C++中OutputData::sucCount方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputData::sucCount方法的具体用法?C++ OutputData::sucCount怎么用?C++ OutputData::sucCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputData
的用法示例。
在下文中一共展示了OutputData::sucCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
bool yarp::manager::exportDotGraph(Graph& graph, const char* szFileName)
{
ofstream dot;
dot.open(szFileName);
if(!dot.is_open())
return false;
dot<<"digraph G {"<<endl;
dot<<"rankdir=LR;"<<endl;
dot<<"ranksep=0.0;"<<endl;
dot<<"nodesep=0.2;"<<endl;
for(GraphIterator itr=graph.begin(); itr!=graph.end(); itr++)
{
switch((*itr)->getType()) {
case MODULE: {
Module* mod = (Module*)(*itr);
dot<<"\""<<mod->getLabel()<<"\"";
dot<<" [label=\""<< mod->getName()<<"\"";
dot<<" shape=component, color=midnightblue, fillcolor=lightslategrey, peripheries=1, style=filled, penwidth=2];"<<endl;
for(int i=0; i<mod->sucCount(); i++)
{
Link l = mod->getLinkAt(i);
InputData* in = (InputData*)l.to();
dot<<"\""<<mod->getLabel()<<"\" -> ";
dot<<"\""<<in->getLabel()<<"\"";
if(!l.isVirtual())
dot<<" [label=\"\"];"<<endl;
else
dot<<" [label=\"\" style=dashed];"<<endl;
}
break;
}
case INPUTD: {
InputData* in = (InputData*)(*itr);
dot<<"\""<<in->getLabel()<<"\"";
if(in->withPriority())
{
dot<<" [color=red, fillcolor=lightgrey, peripheries=1, style=filled";
dot<<" label=\""<< in->getName()<<"\\n"<<in->getPort()<<"\"];"<<endl;
}
else
{
dot<<" [color=black, fillcolor=lightgrey, peripheries=1, style=filled";
dot<<" label=\""<< in->getName()<<"\\n"<<in->getPort()<<"\"];"<<endl;
}
for(int i=0; i<in->sucCount(); i++)
{
Link l = in->getLinkAt(i);
OutputData* out = (OutputData*)l.to();
dot<<"\""<<in->getLabel()<<"\" -> ";
dot<<"\""<<out->getLabel()<<"\"";
if(!l.isVirtual())
dot<<" [label=\""<<l.weight()<<"\"];"<<endl;
else
dot<<" [label=\""<<l.weight()<<"\" style=dashed];"<<endl;
}
break;
}
case OUTPUTD: {
OutputData* out = (OutputData*)(*itr);
dot<<"\""<<out->getLabel()<<"\"";
dot<<" [color=black, fillcolor=wheat, peripheries=1, style=filled";
dot<<" label=\""<< out->getName()<<"\\n"<<out->getPort()<<"\"];"<<endl;
for(int i=0; i<out->sucCount(); i++)
{
Link l = out->getLinkAt(i);
Module* mod = (Module*)l.to();
dot<<"\""<<out->getLabel()<<"\" -> ";
dot<<"\""<<mod->getLabel()<<"\"";
dot<<" [label=\"\" arrowhead=none];"<<endl;
}
break;
}
case APPLICATION: {
Application* app = (Application*)(*itr);
dot<<"\""<<app->getLabel()<<"\"";
dot<<" [shape=folder, color=darkgreen, fillcolor=darkseagreen, peripheries=1, style=filled, penwidth=2";
dot<<" label=\""<<app->getLabel()<<"\""<<"];"<<endl;
for(int i=0; i<app->sucCount(); i++)
{
Link l = app->getLinkAt(i);
Module* mod = (Module*)l.to();
dot<<"\""<<app->getLabel()<<"\" -> ";
dot<<"\""<<mod->getLabel()<<"\"";
if(!l.isVirtual())
dot<<" [label=\"\"];"<<endl;
else
dot<<" [label=\"\" style=dashed];"<<endl;
}
break;
}
case RESOURCE: {
GenericResource* res = (GenericResource*)(*itr);
//.........这里部分代码省略.........