首页> 外国专利> Method for generating an object data structure layout for a class in a compiler for an object-oriented programming language

Method for generating an object data structure layout for a class in a compiler for an object-oriented programming language

机译:在面向对象编程语言的编译器中为类生成对象数据结构布局的方法

摘要

A method for a computer compiler for an object-oriented programming language for implementing virtual functions and virtual base classes is provided. In preferred embodiments of the present invention, the data structure layout of an object includes a virtual function table pointer, a virtual base table pointer, occurrences of each non-virtual base class, the data members of the class, and occurrences of each virtual base class. If a class introduces a virtual function member and the class has a non- virtual base class with a virtual function table pointer, then the class shares the virtual function table pointer of the non-virtual base class that is first visited in a depth-first, left-to- right traversal of the inheritance tree. In preferred embodiments of the present invention, each instance of a given class shares a set of virtual function tables and virtual base tables for that class. In preferred embodiments, adjusters are used when a function member in a derived class overrides a function member that is defined in more than one base class, and when a derived class has a base class that overrides a function member in a virtual base class of that class and the derived class itself does not override the function member.
机译:提供了一种用于面向对象的编程语言的计算机编译器的方法,用于实现虚拟功能和虚拟基类。在本发明的优选实施例中,对象的数据结构布局包括虚拟功能表指针,虚拟基表指针,每个非虚拟基类的出现,该类的数据成员以及每个虚拟基的出现类。如果某个类引入了虚拟函数成员,并且该类具有带有虚拟函数表指针的非虚拟基类,则该类将共享首先在深度优先中访问的非虚拟基类的虚拟函数表指针。 ,即继承树的从左到右遍历。在本发明的优选实施例中,给定类的每个实例共享该类的一组虚拟功能表和虚拟基表。在优选实施例中,当派生类中的函数成员重写在一个以上基类中定义的函数成员时,并且当派生类的基类重写该类的虚拟基类中的函数成员时,将使用调节器。类和派生类本身不会覆盖函数成员。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号