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


C++ ContainedPtr类代码示例

本文整理汇总了C++中ContainedPtr的典型用法代码示例。如果您正苦于以下问题:C++ ContainedPtr类的具体用法?C++ ContainedPtr怎么用?C++ ContainedPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ContainedPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
FreezeScript::AnalyzeInitVisitor::typeChange(const TypePtr& t, const string& scoped, const string& kind)
{
    BuiltinPtr b = BuiltinPtr::dynamicCast(t);
    ContainedPtr c = ContainedPtr::dynamicCast(t);
    ProxyPtr p = ProxyPtr::dynamicCast(t);

    _out.newline();
    _out.newline();
    _out << "<!-- NOTICE: " << scoped << " has changed from ";
    if(b)
    {
        _out << b->kindAsString();
    }
    else if(p)
    {
        _out << "proxy";
    }
    else
    {
        assert(c);
        _out << c->kindOf();
    }
    _out << " to " << kind << " -->";
}
开发者ID:Jonavin,项目名称:ice,代码行数:25,代码来源:TransformAnalyzer.cpp

示例2: fixId

string
Slice::JsGenerator::typeToString(const TypePtr& type)
{
    if(!type)
    {
        return "void";
    }

    static const char* builtinTable[] =
    {
        "Number",           // byte
        "Boolean",          // bool
        "Number",           // short
        "Number",           // int
        "Number",           // long
        "Number",           // float
        "Number",           // double
        "String",
        "Ice.Value",
        "Ice.ObjectPrx",
        "Object",
        "Ice.Value"
    };

    BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
    if(builtin)
    {
        return builtinTable[builtin->kind()];
    }

    ProxyPtr proxy = ProxyPtr::dynamicCast(type);
    if(proxy)
    {
        return fixId(proxy->_class()->scoped() + "Prx");
    }

    SequencePtr seq = SequencePtr::dynamicCast(type);
    if(seq)
    {
        return typeToString(seq->type()) + "[]";
    }

    DictionaryPtr d = DictionaryPtr::dynamicCast(type);
    if(d)
    {
        const TypePtr keyType = d->keyType();
        BuiltinPtr b = BuiltinPtr::dynamicCast(keyType);
        return ((b && b->kind() == Builtin::KindLong) || StructPtr::dynamicCast(keyType)) ? "Ice.HashMap" : "Map";
    }

    ContainedPtr contained = ContainedPtr::dynamicCast(type);
    if(contained)
    {
        return fixId(contained->scoped());
    }

    return "???";
}
开发者ID:ming-hai,项目名称:ice,代码行数:58,代码来源:JsUtil.cpp

示例3: fixId

string
Slice::ObjCGenerator::getParamName(const ContainedPtr& param, bool internal)
{
    if(internal)
    {
        return "iceP_" + param->name();
    }
    else
    {
        return fixId(param->name());
    }
}
开发者ID:zmyer,项目名称:ice,代码行数:12,代码来源:ObjCUtil.cpp

示例4: lookupParamIdKwd

string
Slice::ObjCGenerator::getParamId(const ContainedPtr& param)
{
    string n;
    if(ParamDeclPtr::dynamicCast(param) && param->findMetaData("objc:param:", n))
    {
        return lookupParamIdKwd(n.substr(11));
    }
    else
    {
        return lookupParamIdKwd(param->name());
    }
}
开发者ID:joshmoore,项目名称:ice,代码行数:13,代码来源:ObjCUtil.cpp

示例5: fixIdent

string
Slice::Ruby::getAbsolute(const ContainedPtr& cont, IdentStyle style, const string& prefix)
{
    string scope = fixIdent(cont->scope(), IdentToUpper);

    if(prefix.empty())
    {
        return scope + fixIdent(cont->name(), style);
    }
    else
    {
        return scope + prefix + fixIdent(cont->name(), style);
    }
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:14,代码来源:RubyUtil.cpp

示例6: while

ModulePtr
Slice::ObjCGenerator::findModule(const ContainedPtr& cont, int baseTypes, bool mangleCasts)
{
    ModulePtr m = ModulePtr::dynamicCast(cont);
    ContainerPtr container = cont->container();
    while(container && !m)
    {
        ContainedPtr contained = ContainedPtr::dynamicCast(container);
        container = contained->container();
        m = ModulePtr::dynamicCast(contained);
    }
    assert(m);
    return m;
}
开发者ID:joshmoore,项目名称:ice,代码行数:14,代码来源:ObjCUtil.cpp

示例7:

void
Slice::ObjCGenerator::MetaDataVisitor::setMetaData(const ContainedPtr& cont, const StringList& metadata)
{
    StringList localMetaData = cont->getMetaData();
    for(StringList::const_iterator p = localMetaData.begin(); p != localMetaData.end();)
    {
        string s = *p++;
        if(s.find(_objcPrefix) == 0)
        {
            localMetaData.remove(s);
        }
    }
    localMetaData.insert(localMetaData.end(), metadata.begin(), metadata.end());
    cont->setMetaData(localMetaData);
}
开发者ID:zmyer,项目名称:ice,代码行数:15,代码来源:ObjCUtil.cpp

示例8: if

string
Slice::ObjCGenerator::getFactoryMethod(const ContainedPtr& p, bool deprecated)
{
    ClassDefPtr def = ClassDefPtr::dynamicCast(p);
    if(def && def->declaration()->isLocal())
    {
        deprecated = false; // Local classes don't have this issue since they were added after this fix.
    }

    //
    // If deprecated is true, we return uDPConnectionInfo for a class
    // named UDPConnectionInfo, return udpConnectionInfo otherwise.
    //
    string name = fixId(p->name());
    if(name.empty())
    {
        return name;
    }
    else if(deprecated || name.size() < 2 || !isupper(*(name.begin() + 1)))
    {
        *name.begin() = tolower(*name.begin());
    }
    else
    {
        for(string::iterator p = name.begin(); p != name.end() && isalpha(*p); ++p)
        {
            if(p != name.end() - 1 && isalpha(*(p + 1)) && !isupper(*(p + 1)))
            {
                break;
            }
            *p = tolower(*p);
        }
    }
    return name;
}
开发者ID:joshmoore,项目名称:ice,代码行数:35,代码来源:ObjCUtil.cpp

示例9: if

string
Slice::JsGenerator::importPrefix(const ContainedPtr& contained,
                                 const ContainedPtr& toplevel,
                                 const vector<pair<string, string> >& imports)
{
    string m1 = getModuleMetadata(contained);
    string m2 = getModuleMetadata(toplevel);

    string p;

    if(m1.empty())
    {
        string p1 = contained->definitionContext()->filename();
        string p2 = toplevel->definitionContext()->filename();

        p = relativePath(p1, p2);

        string::size_type pos = p.rfind('.');
        if (pos != string::npos)
        {
            p.erase(pos);
        }
    }
    else if(m1 == "ice" && m1 != m2)
    {
        return "iceNS0.";
    }
    else if(m1 != m2)
    {
        p = m1;
    }

    if(!p.empty())
    {
        for(vector<pair<string, string> >::const_iterator i = imports.begin(); i != imports.end(); ++i)
        {
            if(i->first == p)
            {
                return i->second + ".";
            }
        }
    }

    return "";
}
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:45,代码来源:JsUtil.cpp

示例10: if

string
FreezeScript::typeToString(const TypePtr& type)
{
    BuiltinPtr b = BuiltinPtr::dynamicCast(type);
    ContainedPtr c = ContainedPtr::dynamicCast(type);
    if(b)
    {
        return b->kindAsString();
    }
    else if(c)
    {
        return c->scoped();
    }
    else
    {
        ProxyPtr p = ProxyPtr::dynamicCast(type);
        assert(p);
        return p->_class()->scoped() + "*";
    }
}
开发者ID:ming-hai,项目名称:freeze,代码行数:20,代码来源:Util.cpp

示例11: scopedToName

void
CodeVisitor::startNamespace(const ContainedPtr& cont)
{
    if(_ns)
    {
        string scope = cont->scope();
        scope = scope.substr(2); // Removing leading '::'
        scope = scope.substr(0, scope.length() - 2); // Removing trailing '::'
        _out << sp << nl << "namespace " << scopedToName(scope, true);
        _out << sb;
    }
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:12,代码来源:Main.cpp

示例12: fixIdent

string
CodeVisitor::getName(const ContainedPtr& p, const string& suffix)
{
    if(_ns)
    {
        return fixIdent(p->name() + suffix);
    }
    else
    {
        return getAbsolute(p, false, "", suffix);
    }
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:12,代码来源:Main.cpp

示例13: assert

string
Slice::JsGenerator::getModuleMetadata(const ContainedPtr& p)
{
    //
    // Check if the file contains the python:pkgdir global metadata.
    //
    DefinitionContextPtr dc = p->definitionContext();
    assert(dc);
    const string prefix = "js:module:";
    const string value = dc->findMetaData(prefix);
    return value.empty() ? value : value.substr(prefix.size());
}
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:12,代码来源:JsUtil.cpp

示例14: assert

string Slice::ChecksumVisitor::typeToString(const TypePtr& type)
{
  static const char* builtinTable[] = { "byte", "boolean", "short", "int", "long", "float",
      "double", "string", "Object", "Object*", "LocalObject" };

  if (!type) {
    return "void";
  }

  BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
  if (builtin) {
    return builtinTable[builtin->kind()];
  }

  ProxyPtr proxy = ProxyPtr::dynamicCast(type);
  if (proxy) {
    return proxy->_class()->scoped() + "*";
  }

  ContainedPtr cont = ContainedPtr::dynamicCast(type);
  assert(cont);
  return cont->scoped();
}
开发者ID:wuhua988,项目名称:icm,代码行数:23,代码来源:Checksum.cpp

示例15: assert

string
Slice::JsGenerator::getStaticId(const TypePtr& type)
{
    BuiltinPtr b = BuiltinPtr::dynamicCast(type);
    ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);

    assert((b && b->kind() == Builtin::KindObject) || cl);

    if(b)
    {
        return "Ice.ObjectImpl.ice_staticId()";
    }
    else if(cl->isInterface())
    {
        ContainedPtr cont = ContainedPtr::dynamicCast(cl->container());
        assert(cont);
        return fixId(cont->scoped()) + "." + cl->name() + "Disp_.ice_staticId()";
    }
    else
    {
        return fixId(cl->scoped()) + ".ice_staticId()";
    }
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:23,代码来源:JsUtil.cpp


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