本文整理汇总了C++中Proc::setCluster方法的典型用法代码示例。如果您正苦于以下问题:C++ Proc::setCluster方法的具体用法?C++ Proc::setCluster怎么用?C++ Proc::setCluster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proc
的用法示例。
在下文中一共展示了Proc::setCluster方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseCmd
//.........这里部分代码省略.........
} else if (!strcmp(argv[0], "codegen")) {
if (argc > 1 ) {
Cluster *cluster = prog->findCluster(argv[1]);
if (cluster == NULL) {
std::cerr << "cannot find cluster " << argv[1] << "\n";
return 1;
}
prog->generateCode(cluster);
} else {
prog->generateCode();
}
} else if (!strcmp(argv[0], "move")) {
if (argc <= 1) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
if (!strcmp(argv[1], "proc")) {
if (argc <= 3) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
Proc *proc = prog->findProc(argv[2]);
if (proc == NULL) {
std::cerr << "cannot find proc " << argv[2] << "\n";
return 1;
}
Cluster *cluster = prog->findCluster(argv[3]);
if (cluster == NULL) {
std::cerr << "cannot find cluster " << argv[3] << "\n";
return 1;
}
proc->setCluster(cluster);
} else if (!strcmp(argv[1], "cluster")) {
if (argc <= 3) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
Cluster *cluster = prog->findCluster(argv[2]);
if (cluster == NULL) {
std::cerr << "cannot find cluster " << argv[2] << "\n";
return 1;
}
Cluster *parent = prog->findCluster(argv[3]);
if (parent == NULL) {
std::cerr << "cannot find cluster " << argv[3] << "\n";
return 1;
}
parent->addChild(cluster);
} else {
std::cerr << "don't know how to move a " << argv[1] << "\n";
return 1;
}
} else if (!strcmp(argv[0], "add")) {
if (argc <= 1) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
if (!strcmp(argv[1], "cluster")) {
if (argc <= 2) {
std::cerr << "not enough arguments for cmd\n";
return 1;