本文整理汇总了C++中BaseObject::getSlave方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseObject::getSlave方法的具体用法?C++ BaseObject::getSlave怎么用?C++ BaseObject::getSlave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::getSlave方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findLinkDestClass
//.........这里部分代码省略.........
#endif
}
else
{
Parents parents = node->getParents();
if (parents.empty()) return NULL;
node = dynamic_cast<Node*>(parents[0]); // TODO: explore other parents
if (!node) return NULL;
#ifdef DEBUG_LINK
std::cout << " to parent node " << node->getName() << std::endl;
#endif
}
based = true;
}
else if (pathStr[ppos] == '/')
{
// extra /
#ifdef DEBUG_LINK
std::cout << " extra '/'" << std::endl;
#endif
ppos += 1;
}
else
{
std::size_t p2pos = pathStr.find('/',ppos);
if (p2pos == std::string::npos) p2pos = psize;
std::string name = pathStr.substr(ppos,p2pos-ppos);
ppos = p2pos+1;
if (master)
{
#ifdef DEBUG_LINK
std::cout << " to slave object " << name << std::endl;
#endif
master = master->getSlave(name);
if (!master) return NULL;
}
else
{
for (;;)
{
BaseObject* obj = node->getObject(name);
Node* child = node->getChild(name);
if (child)
{
node = child;
#ifdef DEBUG_LINK
std::cout << " to child node " << name << std::endl;
#endif
break;
}
else if (obj)
{
master = obj;
#ifdef DEBUG_LINK
std::cout << " to object " << name << std::endl;
#endif
break;
}
if (based) return NULL;
// this can still be found from an ancestor node
Parents parents = node->getParents();
if (parents.empty()) return NULL;
node = dynamic_cast<Node*>(parents[0]); // TODO: explore other parents
if (!node) return NULL;
#ifdef DEBUG_LINK
std::cout << " looking in ancestor node " << node->getName() << std::endl;