发明名称 Method and system for accessing virtual base classes
摘要 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.
申请公布号 US5854931(A) 申请公布日期 1998.12.29
申请号 US19970788080 申请日期 1997.01.22
申请人 MICROSOFT CORPORATION 发明人 JONES, DAVID T.;O'RIORDAN, MARTIN J.;ZBIKOWSKI, MARK J.
分类号 G06F9/42;G06F9/45;(IPC1-7):G06F9/45;G06F15/00 主分类号 G06F9/42
代理机构 代理人
主权项
地址