Method and system for accessing virtual base classes
AssigneeMicrosoft Corporation
InventorsDavid T. Jones, Martin J. O'Riordan, Mark J. Zbikowski
Life of this patent
Estimating the term…
Loading patent…
AssigneeMicrosoft Corporation
InventorsDavid T. Jones, Martin J. O'Riordan, Mark J. Zbikowski
Estimating the term…
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.
A method in a computer system for generating an object data structure layout for a derived class, the derived class inheriting a base class, the base class virtually inheriting a virtual base class, the virtual base class having a virtual function member that is overridden by an overriding virtual function member in the base class but not overridden in the derived class, the method comprising the steps of:
A method in a computer system for accessing an occurrence of a base class inherited by a derived class, the base class virtually inheriting a virtual base class, the base class having a virtual function member that overrides a virtual function member of the virtual base class, the overriding virtual function member being compiled to access the occurrence of the base class at a predetermined location relative to a this pointer passed to the overriding virtual function member, the method comprising the steps of:
A method in a computer system for accessing an occurrence of a base class inherited by a derived class, the base class virtually inheriting a virtual base class, the base class having a virtual function member that overrides a virtual function member of the virtual base class, the overriding virtual function member being compiled to access the occurrence of the base class at a predetermined location relative to a this pointer passed to the overriding virtual function member, the method comprising the steps of:
A computer-readable medium containing instructions for causing a computer system to access an occurrence of a base class inherited by a derived class, the base class virtually inheriting a virtual base class, the base class having a virtual function member that overrides a virtual function member of the virtual base class, the overriding virtual function member being compiled to access the occurrence of the base class at a predetermined location relative to a this pointer passed to the overriding virtual function member, by:
Dependencies are inferred from the claim text.