当前位置: 首页>>代码示例>>C++>>正文


C++ DictionaryPtr::scoped方法代码示例

本文整理汇总了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;
}
开发者ID:Jonavin,项目名称:ice,代码行数:29,代码来源:TransformAnalyzer.cpp

示例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();
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:55,代码来源:Main.cpp

示例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());
}
开发者ID:wuhua988,项目名称:icm,代码行数:11,代码来源:Checksum.cpp

示例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?()
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:18,代码来源:RubyUtil.cpp

示例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;
开发者ID:Jonavin,项目名称:ice,代码行数:67,代码来源:TransformAnalyzer.cpp


注:本文中的DictionaryPtr::scoped方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。