本文整理汇总了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;
}
示例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();
}