当前位置: 首页>>代码示例>>C++>>正文


C++ Datum::getValue方法代码示例

本文整理汇总了C++中Datum::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Datum::getValue方法的具体用法?C++ Datum::getValue怎么用?C++ Datum::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Datum的用法示例。


在下文中一共展示了Datum::getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: operator

    bool operator() (const Datum &i, const Datum &j)
    {
      if(i.valueKnown() && !j.valueKnown())
	return true;
      if(!i.valueKnown() && j.valueKnown())
	return false;
      return i.getValue()<j.getValue();
    }
开发者ID:vegard,项目名称:cmpsat,代码行数:8,代码来源:GehanWilcoxon.hpp

示例2: getValue

PyObject* ShapeInputHandler::getValue() const
{
    // Otherwise, OR together all of the input shapes
    // (or return NULL if any of them are invalid)
    PyObject* out = NULL;
    bool valid = true;
    PyObject* or_function = PyUnicode_FromString("__or__");
    for (auto i : in)
    {
        // We check to see if the pointer has been deleted or has been reduced
        // to a QObject (because destroyed is emitted before complete destruction,
        // see note above in SingleInputHandler::hasInput)
        if (i.isNull() || dynamic_cast<Datum*>(i->parent()) == NULL)
        {
            continue;
        }

        // Link source and target
        Q_ASSERT(dynamic_cast<Datum*>(i->parent()));
        Datum* source = static_cast<Datum*>(i->parent());
        Q_ASSERT(dynamic_cast<Datum*>(parent()));
        Datum* target = static_cast<Datum*>(parent());

        valid &= target->connectUpstream(source) && source->getValid();

        if (!valid)
            continue;

        if (out == NULL)
        {
            out = source->getValue();
            Py_INCREF(out);
        }
        else
        {
            PyObject* next = PyObject_CallMethodObjArgs(
                                 out, or_function, source->getValue(), NULL);
            Py_DECREF(out);
            out = next;

        }
    }

    Py_DECREF(or_function);
    if (valid)
    {
        return out;
    }
    else
    {
        Py_XDECREF(out);
        return NULL;
    }
}
开发者ID:aberg001,项目名称:antimony,代码行数:54,代码来源:input.cpp

示例3: 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;
}
开发者ID:Highstaker,项目名称:antimony,代码行数:32,代码来源:proxy.cpp


注:本文中的Datum::getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。