本文整理汇总了C++中StructPtr::getMetaData方法的典型用法代码示例。如果您正苦于以下问题:C++ StructPtr::getMetaData方法的具体用法?C++ StructPtr::getMetaData怎么用?C++ StructPtr::getMetaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructPtr
的用法示例。
在下文中一共展示了StructPtr::getMetaData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stringTypeToString
string
Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx)
{
static const char* outputBuiltinTable[] =
{
"::Ice::Byte&",
"bool&",
"::Ice::Short&",
"::Ice::Int&",
"::Ice::Long&",
"::Ice::Float&",
"::Ice::Double&",
"::std::string&",
"::Ice::ObjectPtr&",
"::Ice::ObjectPrx&",
"::Ice::LocalObjectPtr&"
};
if(optional)
{
return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx)) +">&";
}
BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
if(builtin)
{
if(builtin->kind() == Builtin::KindString)
{
return stringTypeToString(type, metaData, typeCtx) + "&";
}
else
{
return outputBuiltinTable[builtin->kind()];
}
}
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
if(cl)
{
return fixKwd(cl->scoped() + "Ptr&");
}
StructPtr st = StructPtr::dynamicCast(type);
if(st)
{
if(findMetaData(st->getMetaData()) == "%class")
{
return fixKwd(st->scoped() + "Ptr&");
}
return fixKwd(st->scoped()) + "&";
}
ProxyPtr proxy = ProxyPtr::dynamicCast(type);
if(proxy)
{
return fixKwd(proxy->_class()->scoped() + "Prx&");
}
SequencePtr seq = SequencePtr::dynamicCast(type);
if(seq)
{
return sequenceTypeToString(seq, metaData, typeCtx) + "&";
}
DictionaryPtr dict = DictionaryPtr::dynamicCast(type);
if(dict)
{
return dictionaryTypeToString(dict, metaData, typeCtx) + "&";
}
ContainedPtr contained = ContainedPtr::dynamicCast(type);
if(contained)
{
return fixKwd(contained->scoped()) + "&";
}
return "???";
}
示例2: stringTypeToString
//.........这里部分代码省略.........
if(cl->isInterface())
{
return "::std::shared_ptr<::Ice::Value>";
}
else
{
return "::std::shared_ptr<" + fixKwd(cl->scoped()) + ">";
}
}
}
}
else
{
return "const " + fixKwd(cl->scoped() + "Ptr&");
}
}
StructPtr st = StructPtr::dynamicCast(type);
if(st)
{
if(cpp11)
{
if(st->isLocal() || (typeCtx & TypeContextLocalOperation) || (typeCtx & TypeContextAMD))
{
return "const " + fixKwd(st->scoped()) + "&";
}
else
{
return fixKwd(st->scoped());
}
}
else
{
if(findMetaData(st->getMetaData()) == "%class")
{
return "const " + fixKwd(st->scoped() + "Ptr&");
}
else
{
return "const " + fixKwd(st->scoped()) + "&";
}
}
}
ProxyPtr proxy = ProxyPtr::dynamicCast(type);
if(proxy)
{
if(cpp11)
{
ClassDefPtr def = proxy->_class()->definition();
//
// Non local classes without operations map to the base
// proxy class shared_ptr<Ice::ObjectPrx>
//
if(typeCtx & TypeContextLocalOperation)
{
if(def && !def->isInterface() && def->allOperations().empty())
{
return "const ::std::shared_ptr<::Ice::ObjectPrx>&";
}
else
{
return "const ::std::shared_ptr<" + fixKwd(proxy->_class()->scoped() + "Prx") + ">&";
}
}
else