本文整理汇总了C++中DataDescriptor::setMetadata方法的典型用法代码示例。如果您正苦于以下问题:C++ DataDescriptor::setMetadata方法的具体用法?C++ DataDescriptor::setMetadata怎么用?C++ DataDescriptor::setMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataDescriptor
的用法示例。
在下文中一共展示了DataDescriptor::setMetadata方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
vector<ImportDescriptor*> SignatureSetImporter::createImportDescriptors(DOMTreeWalker* pTree, vector<string> &datasetPath)
{
vector<ImportDescriptor*> descriptors;
FactoryResource<DynamicObject> pMetadata;
VERIFYRV(pMetadata.get() != NULL, descriptors);
string datasetName = StringUtilities::toDisplayString(mDatasetNumber++);
for (DOMNode* pChld = pTree->firstChild(); pChld != NULL; pChld = pTree->nextSibling())
{
if (XMLString::equals(pChld->getNodeName(), X("metadata")))
{
DOMElement* pElmnt = static_cast<DOMElement*>(pChld);
string name = A(pElmnt->getAttribute(X("name")));
string val = A(pElmnt->getAttribute(X("value")));
pMetadata->setAttribute(name, val);
if (name == "Name")
{
datasetName = val;
}
}
else if (XMLString::equals(pChld->getNodeName(), X("signature_set")))
{
datasetPath.push_back(datasetName);
vector<ImportDescriptor*> sub = createImportDescriptors(pTree, datasetPath);
datasetPath.pop_back();
descriptors.insert(descriptors.end(), sub.begin(), sub.end());
pTree->parentNode();
}
}
ImportDescriptorResource pImportDescriptor(datasetName, "SignatureSet", datasetPath);
VERIFYRV(pImportDescriptor.get() != NULL, descriptors);
DataDescriptor* pDataDescriptor = pImportDescriptor->getDataDescriptor();
VERIFYRV(pDataDescriptor != NULL, descriptors);
FactoryResource<SignatureFileDescriptor> pFileDescriptor;
VERIFYRV(pFileDescriptor.get() != NULL, descriptors);
pFileDescriptor->setFilename(mFilename);
datasetPath.push_back(datasetName);
string loc = "/" + StringUtilities::join(datasetPath, "/");
datasetPath.pop_back();
pFileDescriptor->setDatasetLocation(loc);
pDataDescriptor->setFileDescriptor(pFileDescriptor.get());
pDataDescriptor->setMetadata(pMetadata.get());
descriptors.push_back(pImportDescriptor.release());
return descriptors;
}
示例2: copy
DataDescriptor* DataDescriptorImp::copy(const string& name, const vector<string>& parent) const
{
ModelServicesImp* pModel = ModelServicesImp::instance();
if (pModel == NULL)
{
return NULL;
}
DataDescriptor* pDescriptor = pModel->createDataDescriptor(name, mType, parent);
if (pDescriptor != NULL)
{
pDescriptor->setClassification(dynamic_cast<const Classification*>(&mClassification));
pDescriptor->setMetadata(dynamic_cast<const DynamicObject*>(&mMetadata));
pDescriptor->setProcessingLocation(mProcessingLocation);
pDescriptor->setFileDescriptor(dynamic_cast<FileDescriptor*>(mpFileDescriptor));
}
return pDescriptor;
}