本文整理汇总了C++中DictionaryPtr::scoped方法的典型用法代码示例。如果您正苦于以下问题:C++ DictionaryPtr::scoped方法的具体用法?C++ DictionaryPtr::scoped怎么用?C++ DictionaryPtr::scoped使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DictionaryPtr
的用法示例。
在下文中一共展示了DictionaryPtr::scoped方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: typeChange
void
FreezeScript::AnalyzeInitVisitor::visitDictionary(const DictionaryPtr& v)
{
if(v->isLocal())
{
return;
}
string scoped = v->scoped();
TypeList l = _oldUnit->lookupTypeNoBuiltin(scoped, false);
if(!l.empty())
{
DictionaryPtr d = DictionaryPtr::dynamicCast(l.front());
if(!d)
{
typeChange(l.front(), scoped, "dictionary");
}
else
{
return;
}
}
_out.newline();
_out.newline();
_out << "<!-- dictionary " << scoped << " -->";
_out << se("init") << attr("type", scoped);
_out << ee;
}
示例2: if
void
CodeVisitor::visitDictionary(const DictionaryPtr& p)
{
TypePtr keyType = p->keyType();
BuiltinPtr b = BuiltinPtr::dynamicCast(keyType);
if(b)
{
switch(b->kind())
{
case Slice::Builtin::KindBool:
case Slice::Builtin::KindByte:
case Slice::Builtin::KindShort:
case Slice::Builtin::KindInt:
case Slice::Builtin::KindLong:
case Slice::Builtin::KindString:
//
// These types are acceptable as dictionary keys.
//
break;
case Slice::Builtin::KindFloat:
case Slice::Builtin::KindDouble:
emitWarning(p->file(), p->line(), "dictionary key type not supported in PHP");
break;
case Slice::Builtin::KindObject:
case Slice::Builtin::KindObjectProxy:
case Slice::Builtin::KindLocalObject:
assert(false);
}
}
else if(!EnumPtr::dynamicCast(keyType))
{
emitWarning(p->file(), p->line(), "dictionary key type not supported in PHP");
}
string type = getTypeVar(p);
startNamespace(p);
//
// Emit the type information.
//
string scoped = p->scoped();
_out << sp << nl << "if(!isset(" << type << "))";
_out << sb;
_out << nl << type << " = IcePHP_defineDictionary('" << scoped << "', ";
writeType(p->keyType());
_out << ", ";
writeType(p->valueType());
_out << ");";
_out << eb;
endNamespace();
}
示例3: typeToString
void Slice::ChecksumVisitor::visitDictionary(const DictionaryPtr& p)
{
if (p->isLocal()) {
return;
}
ostringstream ostr;
ostr << "dictionary<" << typeToString(p->keyType()) << ", " << typeToString(p->valueType())
<< "> " << p->name() << endl;
updateMap(p->scoped(), ostr.str());
}
示例4: fixIdent
void
Slice::Ruby::CodeVisitor::visitDictionary(const DictionaryPtr& p)
{
//
// Emit the type information.
//
string name = fixIdent(p->name(), IdentToUpper);
string scoped = p->scoped();
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
_out.inc();
_out << nl << "T_" << name << " = ::Ice::__defineDictionary('" << scoped << "', ";
writeType(p->keyType());
_out << ", ";
writeType(p->valueType());
_out << ")";
_out.dec();
_out << nl << "end"; // if not defined?()
}
示例5: assert
//.........这里部分代码省略.........
if(cl || (newb && newb->kind() == Builtin::KindObject))
{
return;
}
break;
}
case Builtin::KindObjectProxy:
{
ProxyPtr p = ProxyPtr::dynamicCast(newType);
if(p || (newb && newb->kind() == Builtin::KindObjectProxy) || (newb && newb->kind() == Builtin::KindString))
{
return;
}
break;
}
case Builtin::KindLocalObject:
{
assert(false);
break;
}
}
typeChange(desc, oldType, newType);
return;
}
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(oldType);
if(cl)
{
if(!cl->definition())
{
_errors.push_back("class " + cl->scoped() + " declared but not defined");
return;
}
//
// Allow target type of Object.
//
BuiltinPtr newb = BuiltinPtr::dynamicCast(newType);
if(newb && newb->kind() == Builtin::KindObject)
{
return;
}
//
// Allow target type of struct.
//
if(StructPtr::dynamicCast(newType))
{
return;
}
ClassDeclPtr newcl = ClassDeclPtr::dynamicCast(newType);
if(newcl)
{
if(!newcl->definition())
{
_errors.push_back("class " + newcl->scoped() + " declared but not defined");
return;
}
if(checkClasses(cl, newcl))
{
return;