本文整理汇总了C++中Link::bindElements方法的典型用法代码示例。如果您正苦于以下问题:C++ Link::bindElements方法的具体用法?C++ Link::bindElements怎么用?C++ Link::bindElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::bindElements方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCastedAssignment
Link * FirstFitAlgorithm::createDummyLink(Link * virtualLink, Assignment * assignment)
{
if ( virtualLink == 0 )
return 0;
Element * first = getCastedAssignment(virtualLink->getFirst(), assignment);
Element * second = getCastedAssignment(virtualLink->getSecond(), assignment);
if ( first == 0 || second == 0 )
return 0;
Link * dummyLink = new Link("dummy_link", virtualLink->getCapacity(), virtualLink->getMaxCapacity());
dummyLink->bindElements(first, second);
return dummyLink;
}
示例2: buildPath
Algorithm::Result NetworkManager::buildPath(Element * from, Element * to, Link * vlink, Assignment * assignment)
{
if ( from == to )
return Algorithm::SUCCESS;
cerr << "[NM]\tBuilding path" << endl;
Link * dummy = new Link("dummy", vlink->getCapacity(), vlink->getMaxCapacity());
dummy->bindElements(from, to);
NetPath path = VirtualLinkRouter::routeDejkstra(dummy, &network);
delete dummy;
if ( path.empty() )
return Algorithm::FAILURE;
addAssignment(vlink, path);
assignment->AddAssignment(vlink, path);
cerr << "[NM]\tPath building succedeed" << endl;
return Algorithm::SUCCESS;
}