本文整理汇总了C++中poco::json::object::Ptr::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::getId方法的具体用法?C++ Ptr::getId怎么用?C++ Ptr::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poco::json::object::Ptr
的用法示例。
在下文中一共展示了Ptr::getId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
void GraphConnection::deserialize(Poco::JSON::Object::Ptr obj)
{
auto outputId = QString::fromStdString(obj->getValue<std::string>("outputId"));
auto inputId = QString::fromStdString(obj->getValue<std::string>("inputId"));
auto outputKey = QString::fromStdString(obj->getValue<std::string>("outputKey"));
auto inputKey = QString::fromStdString(obj->getValue<std::string>("inputKey"));
auto draw = dynamic_cast<GraphDraw *>(this->parent());
assert(draw != nullptr);
//resolve IO objects by id
QPointer<GraphObject> inputObj = nullptr;
QPointer<GraphObject> outputObj = nullptr;
for (const auto obj : draw->getGraphObjects(false))
{
if (obj->getId() == inputId) inputObj = obj;
if (obj->getId() == outputId) outputObj = obj;
}
if (inputObj.isNull()) throw Pothos::Exception("GraphConnection::deserialize()", "cant resolve object with ID: '"+inputId.toStdString()+"'");
if (outputObj.isNull()) throw Pothos::Exception("GraphConnection::deserialize()", "cant resolve object with ID: '"+outputId.toStdString()+"'");
this->setupEndpoint(GraphConnectionEndpoint(inputObj, GraphConnectableKey(inputKey, true)));
this->setupEndpoint(GraphConnectionEndpoint(outputObj, GraphConnectableKey(outputKey, false)));
assert(this->getInputEndpoint().isValid());
assert(this->getOutputEndpoint().isValid());
GraphObject::deserialize(obj);
}