本文整理汇总了C++中Member::IsStructure方法的典型用法代码示例。如果您正苦于以下问题:C++ Member::IsStructure方法的具体用法?C++ Member::IsStructure怎么用?C++ Member::IsStructure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::IsStructure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VirtualMachineException
inline Structure *GetStruct(Module *module, const std::string &className)
{
Member *member = module->GetMember(className);
if(!member || !member->IsStructure())
throw VirtualMachineException("Failed to load " + className);
// Cast the class.
return static_cast<Structure*> (member);
}
示例2: ReadStructure
void TypeGroup::ReadStructure(ModuleReader &reader, const MemberHeader &header)
{
// Read the group members.
Member *parent = GetParent();
Module *module = GetModule();
int count = header.memberSize/4;
for(int i = 0; i < count; i++)
{
uint32_t id;
reader >> id;
// Get the member and check it..
Member *member = module->GetMember(id);
if(!member->IsClass() && !member->IsStructure() && !member->IsInterface())
throw ModuleException("expected class/structure/interface member in type group.");
// Store the member.
buildings.push_back(static_cast<Structure*> (member));
// Update his parent.
if(member && parent)
member->UpdateParent(parent);
}
}