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


C++ Toplevel::uintClass方法代码示例

本文整理汇总了C++中Toplevel::uintClass方法的典型用法代码示例。如果您正苦于以下问题:C++ Toplevel::uintClass方法的具体用法?C++ Toplevel::uintClass怎么用?C++ Toplevel::uintClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Toplevel的用法示例。


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

示例1: newParameterizedVTable

    VTable* VTable::newParameterizedVTable(Traits* param_traits, Stringp fullname)
    {
        Toplevel* toplevel = this->toplevel();
        AvmCore* core = toplevel->core();
        Namespacep traitsNs = this->traits->ns();

        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        GCRef<ObjectVectorClass> vectorobj_cls = builtinClasses->get_Vector_objectClass();
        GCRef<ScopeChain> vectorobj_cscope = vectorobj_cls->vtable->init->scope();
        GCRef<ScopeChain> vectorobj_iscope = vectorobj_cls->ivtable()->init->scope();
        VTable* objVecVTable = vectorobj_cls->vtable;
        AbcEnv* objVecAbcEnv = vectorobj_cscope->abcEnv();
        Toplevel* objVecToplevel = objVecVTable->toplevel();
        VTable* objVecIVTable = objVecVTable->ivtable;

        // these cases should all be filtered out by the caller;
        // we only want to handle Vector<SomeObject> here
        AvmAssert(param_traits != NULL &&
                    param_traits != toplevel->intClass()->vtable->traits->itraits &&
                    param_traits != toplevel->uintClass()->vtable->traits->itraits &&
                    param_traits != toplevel->numberClass()->vtable->traits->itraits);

        PoolObject* traitsPool = this->traits->pool;

        Stringp classname = core->internString(fullname->appendLatin1("$"));
        Traits* ctraits = core->domainMgr()->findTraitsInPoolByNameAndNS(traitsPool, classname, traitsNs);
        Traits* itraits;
        if (!ctraits)
        {
            // important: base the new ctraits on objVecVTable->traits, *not* this->traits;
            // we want the result to be based off ObjectVectorClass, not VectorClass
            // (otherwise sizeofInstance would be too small and we'd be crashy)
            ctraits = objVecVTable->traits->newParameterizedCTraits(classname, traitsNs);
            ctraits->verifyBindings(toplevel);

            itraits = traitsPool->resolveParameterizedType(toplevel, this->ivtable->traits, param_traits);
            ctraits->itraits = itraits;
        }
        else
        {
            itraits = ctraits->itraits;
        }

        AvmAssert(itraits != NULL);

        VTable* class_ivtable = builtinClasses->get_ClassClass()->ivtable();

        VTable* cvtab = core->newVTable(ctraits, class_ivtable, objVecToplevel);
        ScopeChain* cvtab_cscope = vectorobj_cscope->cloneWithNewVTable(core->GetGC(), cvtab, objVecAbcEnv);

        VTable* ivtab = core->newVTable(itraits, objVecIVTable, objVecToplevel);
        ScopeChain* ivtab_iscope = vectorobj_iscope->cloneWithNewVTable(core->GetGC(), ivtab, objVecAbcEnv);
        cvtab->ivtable = ivtab;
        ivtab->init = objVecIVTable->init;

        cvtab->resolveSignatures(cvtab_cscope);
        ivtab->resolveSignatures(ivtab_iscope);

        return cvtab;
    }
开发者ID:bsdf,项目名称:trx,代码行数:60,代码来源:VTable.cpp


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