本文整理汇总了C++中Datum::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ Datum::parent方法的具体用法?C++ Datum::parent怎么用?C++ Datum::parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Datum
的用法示例。
在下文中一共展示了Datum::parent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAttr
PyObject* NodeProxy::getAttr(std::string name)
{
Datum* datum = node->getDatum(QString::fromStdString(name));
if (!datum)
throw proxy::ProxyException("Nonexistent datum lookup.");
// If we have a known caller, then mark that this datum is an upstream node
// for the caller.
if (caller)
{
// Try to connect this datum as an upstream datum of the caller
if (!caller->connectUpstream(datum))
throw proxy::ProxyException("Recursive loop in lookup.");
// Also connect the node's name as an upstream datum
// (since if the name changes, the expression may become invalid)
Q_ASSERT(dynamic_cast<Node*>(datum->parent()));
Node* n = static_cast<Node*>(datum->parent());
auto name = n->getDatum("__name");
Q_ASSERT(name);
caller->connectUpstream(name);
}
if (!datum->getValid())
throw proxy::ProxyException("Invalid datum lookup.");
PyObject* value = datum->getValue();
Py_INCREF(value);
return value;
}