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


C++ VirtualMachine::GetPropertyInfoClass方法代码示例

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


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

示例1: GetModule

    llvm::GlobalVariable *Property::GetMemberInfo()
    {
        if(!propertyInfo)
        {
            // Only create the property info variable when reflection is enabled.
            Module *module = GetModule();
            if(!module->HasReflection())
                return NULL;

            // Get the property info class.
            VirtualMachine *vm = module->GetVirtualMachine();
            Class *propInfoClass = vm->GetPropertyInfoClass();
            llvm::Module *targetModule = module->GetTargetModule();
            propertyInfo = new llvm::GlobalVariable(*targetModule, propInfoClass->GetTargetType(),
                                    false, ComputeMetadataLinkage(), NULL, GetMangledName() + "_propinfo_");
        }

        return propertyInfo;
    }
开发者ID:ronsaldo,项目名称:chela,代码行数:19,代码来源:Property.cpp

示例2: DefinitionPass

    void Property::DefinitionPass()
    {
        // Only create once the member info.
        if(createdMemberInfo)
            return;
        createdMemberInfo = true;

        // Only create the reflection info in modules that support it.    
        Module *module = GetModule();
        if(!module->HasReflection())
            return;

        // Get the property info class.
        VirtualMachine *vm = module->GetVirtualMachine();
        Class *propInfoClass = vm->GetPropertyInfoClass();

        // Create the property info value.
        ConstantStructurePtr propInfoValue(propInfoClass->CreateConstant(module));

        // Store the MemberInfo attributes.
        SetMemberInfoData(propInfoValue);

        // Set the "getMethod" field.
        if(getAccessor)
            propInfoValue->SetField("getMethod", getAccessor->GetMemberInfo());

        // Set the "setMethod" field.
        if(setAccessor)
            propInfoValue->SetField("setMethod", setAccessor->GetMemberInfo());

        // Set the property type field.
        propInfoValue->SetField("propertyType", GetReflectedType(GetType()));

        // Set the field info.
        GetMemberInfo()->setInitializer(propInfoValue->Finish());

        // Define the custom attributes.
        DefineAttributes();
    }
开发者ID:ronsaldo,项目名称:chela,代码行数:39,代码来源:Property.cpp


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