本文整理汇总了C++中ObjRef::fullyInstantiateImports方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjRef::fullyInstantiateImports方法的具体用法?C++ ObjRef::fullyInstantiateImports怎么用?C++ ObjRef::fullyInstantiateImports使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjRef
的用法示例。
在下文中一共展示了ObjRef::fullyInstantiateImports方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadModel
int CellmlModelDefinition::loadModel(const std::string &url)
{
std::cout << "Creating CellML Model Definition from the URL: "
<< url << std::endl;
mUrl = url;
if (mUrl.empty()) return -1;
std::wstring urlW = s2ws(url);
ObjRef<iface::cellml_api::CellMLBootstrap> cb = CreateCellMLBootstrap();
ObjRef<iface::cellml_api::DOMModelLoader> ml = cb->modelLoader();
int code;
try
{
ObjRef<iface::cellml_api::Model> model = ml->loadFromURL(urlW);
model->fullyInstantiateImports();
// we have a model, so we can start grabbing hold of the CellML API objects
mCapi = new CellmlApiObjects();
mCapi->model = model;
code = instantiateCellmlApiObjects();
}
catch (...)
{
std::wcerr << L"Error loading model: " << urlW << std::endl;
return -1;
}
return code;
}
示例2: loadModelFromString
int CellmlModelDefinition::loadModelFromString(const std::string &ms)
{
std::cout << "Creating CellML Model Definition from the given model string"
<< std::endl;
mUrl = "";
std::wstring msW = s2ws(ms);
ObjRef<iface::cellml_api::CellMLBootstrap> cb = CreateCellMLBootstrap();
ObjRef<iface::cellml_api::DOMModelLoader> ml = cb->modelLoader();
int code;
try
{
ObjRef<iface::cellml_api::Model> model = ml->createFromText(msW);
model->fullyInstantiateImports();
// we have a model, so we can start grabbing hold of the CellML API objects
mCapi = new CellmlApiObjects();
mCapi->model = model;
code = instantiateCellmlApiObjects();
}
catch (...)
{
std::wcerr << L"Error loading model from string." << std::endl;
return -1;
}
return code;
}