← Back to Patent Explorer
US5371891A Expired / Lapsed US ⏱️ 0.0 years remaining

Method for object construction in a compiler for an object-oriented programming language

Assignee: Microsoft Technology Licensing LLC
•
Filing: 1992-04-09
•
Granted: 1994-12-06
•
Expires: 2012-04-09
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract An improved method and system for implementing constructors and destructors in a compiler for an object-oriented programming language is provided. In a preferred embodiment of the present invention, a construction displacement value is added to the this pointer for a virtual function that is invoked by a constructor for a class that virtually inherits a base class. The construction displacement value corresponds to the difference between the offset of an occurrence of a virtually inherited class within an instance of the base class and the offset of the occurrence of the virtually inherited class from the occurrence of the base class within an instance of a derived class that inherits the base class.

Inventors

  • 👤 Jan Gray
  • 👤 David Jones
  • 👤 Martin O'Riordan

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-10-24 19:57
CPC Classifications
G; G06; G06F; G06F9/00; G06F9/06; G06F9/44; G06F9/448; G06F9/4488

Claims Analysis

Total Claims: 90
Claim 1
Independent Claim 405 words
A method in a computer system for constructing an instance of an object, the method comprising the computer-implemented steps of: receiving a declaration of a first class, wherein the first class defines a first class object and wherein the first class defines a virtual function; receiving a declaration of a second class, wherein the second class defines a second class object, wherein an instance of a second class object has an instance address, wherein the second class virtually inherits the first class, wherein a first class object occurs within an instance of a second class object at an offset from the instance address of a second class object, wherein the second class defines a virtual function that overrides the virtual function of the first class, wherein the overriding virtual function is passed a this pointer when invoked, wherein when the virtual function is invoked for an instance of a second class object the passed this pointer points to the occurrence of the first class object within the instance of the second class object, wherein the overriding virtual function determines the instance address of a second class object by adjusting the passed this pointer by the offset, wherein the second class defines a constructor, and wherein the constructor invokes the overriding virtual function; receiving a declaration of a third class, wherein the third class defines a third class object, wherein the third class inherits the second class, and wherein a second class object occurs within an instance of a third class object; and when constructing an instance of a third class object, before executing the constructor of the second class, setting a this pointer for the constructor of the second class to point to the occurrence of the second class object within the instance of the third class object; executing the constructor of the second class; before invoking the overriding virtual function, setting a this pointer for the overriding virtual function to point to an offset from the occurrence of the second class object within the third class object, wherein the offset is the same as the offset of the occurrence of the first class object within an instance of a second class object from the instance address of a second class object; and invoking the overriding virtual function, wherein the overriding virtual function adjusts the this pointer to point to the occurrence of the second class object within the instance of the third class object.
Claim 2
Independent Claim 405 words
A method in a computer system for constructing an instance of an object, the method comprising the computer-implemented steps of: receiving a declaration of a first class, wherein the first class defines a first class object and wherein the first class defines a virtual function; receiving a declaration of a second class, wherein the second class defines a second class object, wherein an instance of a second class object has an instance address, wherein the second class virtually inherits the first class, wherein a first class object occurs within an instance of a second class object at an offset from the instance address of a second class object, wherein the second class defines a virtual function that overrides the virtual function of the first class, wherein the overriding virtual function is passed a this pointer when invoked, wherein when the virtual function is invoked for an instance of a second class object the passed this pointer points to the occurrence of the first class object within the instance of the second class object, wherein the overriding virtual function determines the instance address of a second class object by adjusting the passed this pointer by the offset, wherein the second class defines a constructor, and wherein the constructor invokes the overriding virtual function; receiving a declaration of a third class, wherein the third class defines a third class object, wherein the third class inherits the second class, and wherein a second class object occurs within an instance of a third class object; and when constructing an instance of a third class object, before executing the constructor of the second class, setting a this pointer for the constructor of the second class to point to the occurrence of the second class object within the instance of the third class object; executing the constructor of the second class; before invoking the overriding virtual function, setting a this pointer for the overriding virtual function to point to an offset from the occurrence of the second class object within the third class object, wherein the offset is the same as the offset of the occurrence of the first class object within an instance of a second class object from the instance address of a second class object; and invoking the overriding virtual function, wherein the overriding virtual function adjusts the this pointer to point to the occurrence of the second class object within the instance of the third class object.
Claim 3
Dependent Claim 106 words
The method of claim 1 wherein the step of setting a this pointer for the overriding virtual function includes the steps of: setting the this pointer to point to the occurrence of the first class object within the occurrence of the second class object within the instance of the third class object; and adjusting the this pointer by the difference between the offset of an occurrence of a first class object within an instance of a second class object and the offset of the occurrence of a first class object from an occurrence of a second class object within an instance of a third class object.
Claim 4
Dependent Claim 30 words
The method of claim 2 wherein the value of the difference is stored in the instance of the third class object before invoking the constructor for the second class object.
Claim 5
Independent Claim 154 words
A method in a computer system of constructing an object, the method comprising the computer-implemented steps of: allocating a construction displacement field in an object of a derived class that inherits a base class that virtually inherits a class; and during construction of the object of the derived class, setting the construction displacement field to a value to reflect differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; invoking a constructor of the base class to construct an occurrence of the base class within the object; and during execution of the constructor, setting a this pointer for a virtual function; adjusting the this pointer by the value in the construction displacement field; and invoking the virtual function whereby the virtual function uses the adjusted this pointer to access the occurrence of the base class within the object.
Claim 6
Independent Claim 154 words
A method in a computer system of constructing an object, the method comprising the computer-implemented steps of: allocating a construction displacement field in an object of a derived class that inherits a base class that virtually inherits a class; and during construction of the object of the derived class, setting the construction displacement field to a value to reflect differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; invoking a constructor of the base class to construct an occurrence of the base class within the object; and during execution of the constructor, setting a this pointer for a virtual function; adjusting the this pointer by the value in the construction displacement field; and invoking the virtual function whereby the virtual function uses the adjusted this pointer to access the occurrence of the base class within the object.
Claim 7
Dependent Claim 19 words
The method of claim 4 wherein the virtual function overrides a virtual function defined in the virtually inherited class.
Claim 8
Dependent Claim 26 words
The method of claim 4 including the step of setting the value of the construction displacement field to a zero value after execution of the constructor.
Claim 9
Dependent Claim 24 words
The method of claim 4 wherein the construction displacement field is allocated at a predefined offset from an occurrence of the virtually inherited class.
Claim 10
Dependent Claim 21 words
The method of claim 4 wherein the construction displacement field is stored adjacent to an occurrence of the virtually inherited class.
Claim 11
Dependent Claim 65 words
The method of claim 4 wherein the step of setting the construction displacement field sets the construction displacement field to the difference between the offset of an occurrence of the virtually inherited class within an object of the base class and the offset of an occurrence of the virtually inherited class from an occurrence of the base class within an object of the derived class.
Claim 12
Dependent Claim 19 words
The method of claim 9 wherein the virtual function overrides a virtual function defined in the virtually inherited class.
Claim 13
Independent Claim 68 words
A method in a computer system for determining when to allocate a construction displacement field within an object of a derived class for an occurrence of a base class, the method comprising the computer-implemented steps of: determining whether the derived class virtually inherits the base class; and when the derived class virtually inherits the base class, allocating a construction displacement field for the occurrence of the base class.
Claim 14
Independent Claim 68 words
A method in a computer system for determining when to allocate a construction displacement field within an object of a derived class for an occurrence of a base class, the method comprising the computer-implemented steps of: determining whether the derived class virtually inherits the base class; and when the derived class virtually inherits the base class, allocating a construction displacement field for the occurrence of the base class.
Claim 15
Dependent Claim 28 words
The method of claim 11 including the step of suppressing the allocating of the construction displacement field when the base class has no function members designated as virtual.
Claim 16
Dependent Claim 31 words
The method of claim 11 including the step of suppressing the allocating of the construction displacement field when the derived class has no constructor or destructor that invokes a virtual function.
Claim 17
Dependent Claim 50 words
The method of claim 11 including the step of suppressing the allocating of the construction displacement field when no constructor or destructor that is designated as public or protected in the derived class invokes a virtual function and no class is designated as a friend class of the derived class.
Claim 18
Dependent Claim 23 words
The method of claim 11 including the step of suppressing the allocating of the construction displacement field when the derived class in non-derivable.
Claim 19
Dependent Claim 34 words
The method of claim 11 including the step of suppressing the allocating of the construction displacement field when all virtual functions of the base class that are overridden are pure in the derived class.
Claim 20
Independent Claim 127 words
A method in a computer system of destructing an object, the method comprising the computer-implemented steps of: allocating a construction displacement field in an object of a derived class that inherits a base class that virtually inherits a class; and during destruction of the object of the derived class, setting the construction displacement field to a non-zero value; invoking a destructor of the base class to destruct an occurrence of the base class within the object; and during execution of the destructor, setting a this pointer for a virtual function; adjusting the this pointer by the value in the construction displacement field; and invoking the virtual function whereby the virtual function uses the adjusted this pointer to access the occurrence of the base class within the object.
Claim 21
Independent Claim 127 words
A method in a computer system of destructing an object, the method comprising the computer-implemented steps of: allocating a construction displacement field in an object of a derived class that inherits a base class that virtually inherits a class; and during destruction of the object of the derived class, setting the construction displacement field to a non-zero value; invoking a destructor of the base class to destruct an occurrence of the base class within the object; and during execution of the destructor, setting a this pointer for a virtual function; adjusting the this pointer by the value in the construction displacement field; and invoking the virtual function whereby the virtual function uses the adjusted this pointer to access the occurrence of the base class within the object.
Claim 22
Dependent Claim 19 words
The method of claim 17 wherein the virtual function overrides a virtual function defined in the virtually inherited class.
Claim 23
Dependent Claim 26 words
The method of claim 17 including the step of setting the value of the construction displacement field to a zero value after execution of the destructor.
Claim 24
Dependent Claim 24 words
The method of claim 17 wherein the construction displacement field is stored at a predefined offset from an occurrence of the virtually inherited class.
Claim 25
Dependent Claim 21 words
The method of claim 17 wherein the construction displacement field is stored adjacent to an occurrence of the virtually inherited class.
Claim 26
Dependent Claim 65 words
The method of claim 17 wherein the step of setting the construction displacement field sets the construction displacement field to the difference between the offset of an occurrence of the virtually inherited class within an object of the base class and the offset of an occurrence of the virtually inherited class from an occurrence of the base class within an object of the derived class.
Claim 27
Dependent Claim 19 words
The method of claim 22 wherein the virtual function overrides a virtual function defined in a virtually inherited class.
Claim 28
Dependent Claim 111 words
A compiler in a computer system comprising: means for setting a construction displacement field to a non-zero value; means for generating code for setting a this pointer for a virtual function when executing a constructor or destructor; means for generating code for adjusting the this pointer by the value in the construction displacement field before execution of the virtual function and when executing a constructor or destructor; and means for generating code for invoking the virtual function when executing a constructor or destructor, whereby the virtual function uses the adjusted this pointer to access an occurrence of a base class when an base class within an object of a derived class.
Claim 29
Dependent Claim 111 words
A compiler in a computer system comprising: means for setting a construction displacement field to a non-zero value; means for generating code for setting a this pointer for a virtual function when executing a constructor or destructor; means for generating code for adjusting the this pointer by the value in the construction displacement field before execution of the virtual function and when executing a constructor or destructor; and means for generating code for invoking the virtual function when executing a constructor or destructor, whereby the virtual function uses the adjusted this pointer to access an occurrence of a base class when an base class within an object of a derived class.
Claim 30
Dependent Claim 19 words
The compiler of claim 24 wherein the virtual function overrides a virtual function defined in a virtually inherited class.
Claim 31
Dependent Claim 30 words
The compiler of claim 24 including means for generating code for setting the value of the construction displacement field to a zero value after execution of a constructor or destructor.
Claim 32
Dependent Claim 33 words
The compiler of claim 24 including means for generating code for allocating a construction displacement field in an object of a derived class that inherits a base class that virtually inherits a class.
Claim 33
Dependent Claim 24 words
The complier of claim 27 wherein the construction displacement field is allocated at a predefined offset from an occurrence of the virtually inherited class.
Claim 34
Dependent Claim 21 words
The complier of claim 27 wherein the construction displacement field is allocated adjacent to an occurrence of the virtually inherited class.
Claim 35
Dependent Claim 67 words
The compiler of claim 24 wherein means for generating code for setting the construction displacement field sets the construction displacement field to the difference between an offset of an occurrence of the virtually inherited class within an object of the base class and an offset of an occurrence of the virtually inherited class from an occurrence of the base class within an object of the derived class.
Claim 36
Dependent Claim 19 words
The compiler of claim 30 wherein the virtual function overrides a virtual function defined in the virtually inherited class.
Claim 37
Independent Claim 130 words
A method in a computer system for constructing a derived object of a derived class, the derived class inheriting a base class, the base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: before invoking a constructor for the base class during construction of the derived object, adjusting for differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; and invoking the constructor whereby the constructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class within the derived class based on the adjustments.
Claim 38
Independent Claim 130 words
A method in a computer system for constructing a derived object of a derived class, the derived class inheriting a base class, the base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: before invoking a constructor for the base class during construction of the derived object, adjusting for differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; and invoking the constructor whereby the constructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class within the derived class based on the adjustments.
Claim 39
Dependent Claim 56 words
The method of claim 32 wherein the base class virtually inherits a virtual base class and the virtual function overrides a virtual function defined in the virtual base class and wherein the step of adjusting for differences includes setting a value to reflect any differences resulting from the base class virtually inheriting the virtual base class.
Claim 40
Dependent Claim 81 words
The method of claim 33 including the steps of allocating a construction displacement field for the virtual base class; before invoking the constructor, setting the construction displacement field to a value to reflect differences resulting from the base class virtually inheriting the virtual base class; and during invocation of the constructor, invoking the overriding virtual function passing a this pointer wherein an adjustor adjusts the this pointer by the value of the construction displacement field before executing the overriding virtual function.
Claim 41
Dependent Claim 23 words
The method of claim 34 wherein the step of invoking the overriding virtual function invokes the overriding virtual function directly from the constructor.
Claim 42
Dependent Claim 32 words
The method of claim 34 wherein the step of invoking the overriding virtual function invokes the overriding virtual function indirectly from the constructor through a function that is invoked by the constructor.
Claim 43
Dependent Claim 15 words
The method of claim 34 wherein the derived class does not override the virtual function.
Claim 44
Dependent Claim 15 words
The method of claim 33 wherein the derived class does not override the virtual function.
Claim 45
Dependent Claim 28 words
The method of claim 33 including the step of, after invoking the constructor, resetting the value to reflect the occurrence of the base class within the derived class.
Claim 46
Dependent Claim 22 words
The method of claim 32 including the step of invoking the virtual function passing a this pointer that reflects adjusting for differences.
Claim 47
Dependent Claim 23 words
The method of claim 32 wherein the step of adjusting for differences includes the step of setting a value to reflect the differences.
Claim 48
Dependent Claim 55 words
The method of claim 32 wherein the derived object has a virtual function table and wherein step for adjusting for differences includes setting the virtual function table for the derived object to an alternate virtual function table wherein the virtual function is invoked through the alternate virtual function table during construction of the derived object.
Claim 49
Dependent Claim 52 words
The method of claim 42 wherein the alternate virtual function table contains a reference to an adjuster that adjusts for differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited and that executes the virtual function.
Claim 50
Dependent Claim 29 words
The method of claim 42 wherein the base class virtually inherits a virtual base class and the virtual function overrides a virtual function defined in the virtual base class.
Claim 51
Independent Claim 162 words
A method in a computer system of constructing a derived object of a derived class, the derived class inheriting a base class, the base class virtually inheriting a virtual base class, the method comprising the computer-implemented steps of: allocating a construction displacement field for the derived object; and during construction of the derived object, setting the construction displacement field to a value representative of differences between an occurrence of the base class within the derived object and an occurrence of the base class when the base class is not inherited; invoking a constructor of the base class to construct the occurrence of the base class within the derived object; and during execution of the constructor, setting a this pointer for a virtual function; adjusting the this pointer based on the value in the construction displacement field; and invoking the virtual function whereby the virtual function uses the adjusted this pointer to access the occurrence of the base class within the derived object.
Claim 52
Independent Claim 162 words
A method in a computer system of constructing a derived object of a derived class, the derived class inheriting a base class, the base class virtually inheriting a virtual base class, the method comprising the computer-implemented steps of: allocating a construction displacement field for the derived object; and during construction of the derived object, setting the construction displacement field to a value representative of differences between an occurrence of the base class within the derived object and an occurrence of the base class when the base class is not inherited; invoking a constructor of the base class to construct the occurrence of the base class within the derived object; and during execution of the constructor, setting a this pointer for a virtual function; adjusting the this pointer based on the value in the construction displacement field; and invoking the virtual function whereby the virtual function uses the adjusted this pointer to access the occurrence of the base class within the derived object.
Claim 53
Dependent Claim 58 words
The method of claim 45 including the step of setting the construction displacement field sets the construction displacement field to the difference between an offset of an occurrence of the virtual base class within an object of the base class and an offset of an occurrence of the virtual base class of an object of the derived class.
Claim 54
Dependent Claim 77 words
The method of claim 46 wherein the derived object contains an indication of an occurrence of the virtual base class within the derived object, wherein the step of setting the construction displacement field includes the step of retrieving the indication of the occurrence of the virtual base class within the derived object and retrieving an indication of an occurrence of the virtual base class within an object of the base class that is established during compile time.
Claim 55
Independent Claim 139 words
A method in a computer system of constructing an occurrence of an intermediate class in a derived class, the derived class inheriting the intermediate class, the intermediate class virtually inheriting a base class, the intermediate class having a virtual function that overrides a virtual function in the base class, the overriding virtual function generated to access an object of the intermediate class based on a predefined layout, the method comprising the computer-implemented steps of: before invoking a constructor for the intermediate class to construct an occurrence of the intermediate class within the derived class, determining layout differences between a layout of an occurrence of the intermediate class in the derived class and a layout of an object of the intermediate class; and invoking the constructor whereby the constructor can access the overriding function based on the determined layout differences.
Claim 56
Independent Claim 139 words
A method in a computer system of constructing an occurrence of an intermediate class in a derived class, the derived class inheriting the intermediate class, the intermediate class virtually inheriting a base class, the intermediate class having a virtual function that overrides a virtual function in the base class, the overriding virtual function generated to access an object of the intermediate class based on a predefined layout, the method comprising the computer-implemented steps of: before invoking a constructor for the intermediate class to construct an occurrence of the intermediate class within the derived class, determining layout differences between a layout of an occurrence of the intermediate class in the derived class and a layout of an object of the intermediate class; and invoking the constructor whereby the constructor can access the overriding function based on the determined layout differences.
Claim 57
Independent Claim 112 words
A method in a computer system for destructing a derived object of a derived class, the derived class inheriting a base class, the base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: before invoking a destructor for the base class during destruction of the derived object, adjusting for differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; and invoking the destructor whereby the destructor can invoke the virtual function based on the differences.
Claim 58
Independent Claim 112 words
A method in a computer system for destructing a derived object of a derived class, the derived class inheriting a base class, the base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: before invoking a destructor for the base class during destruction of the derived object, adjusting for differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; and invoking the destructor whereby the destructor can invoke the virtual function based on the differences.
Claim 59
Dependent Claim 56 words
The method of claim 49 wherein the base class virtually inherits a virtual base class and the virtual function overrides a virtual function defined in the virtual base class and wherein the step of adjusting for differences includes setting a value to reflect any differences resulting from the base class virtually inheriting the virtual base class.
Claim 60
Dependent Claim 81 words
The method of claim 50 including the steps of allocating a destruction displacement field for the virtual base class; before invoking the destructor, setting the destruction displacement field to a value to reflect differences resulting from the base class virtually inheriting the virtual base class; and during invocation of the destructor, invoking the overriding virtual function passing a this pointer wherein an adjustor adjusts the this pointer by the value of the destruction displacement field before executing the overriding virtual function.
Claim 61
Dependent Claim 23 words
The method of claim 51 wherein the step of invoking the overriding virtual function invokes the overriding virtual function directly from the destructor.
Claim 62
Dependent Claim 32 words
The method of claim 51 wherein the step of invoking the overriding virtual function invokes the overriding virtual function indirectly from the destructor through a function that is invoked by the destructor.
Claim 63
Dependent Claim 15 words
The method of claim 51 wherein the derived class does not override the virtual function.
Claim 64
Dependent Claim 15 words
The method of claim 50 wherein the derived class does not override the virtual function.
Claim 65
Dependent Claim 28 words
The method of claim 50 including the step of, after invoking the destructor, resetting the value to reflect the occurrence of the base class within the derived class.
Claim 66
Dependent Claim 22 words
The method of claim 50 including the step of invoking the virtual function passing a this pointer that reflects adjusting for differences.
Claim 67
Dependent Claim 23 words
The method of claim 50 wherein the step of adjusting for differences includes the step of setting a value to reflect the differences.
Claim 68
Dependent Claim 120 words
A compiler in a computer system comprising: means for generating code for a constructor for a base class; means for generating code for a virtual function of the base class, the virtual function for accessing an occurrence of the base class when the base class is not inherited; means for generating code to adjust for differences between an occurrence of the base class in a derived class and an occurrence of the base class when the base class is not inherited; and means for generating code for invoking the constructor whereby the constructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class in the derived class based on the differences.
Claim 69
Dependent Claim 120 words
A compiler in a computer system comprising: means for generating code for a constructor for a base class; means for generating code for a virtual function of the base class, the virtual function for accessing an occurrence of the base class when the base class is not inherited; means for generating code to adjust for differences between an occurrence of the base class in a derived class and an occurrence of the base class when the base class is not inherited; and means for generating code for invoking the constructor whereby the constructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class in the derived class based on the differences.
Claim 70
Dependent Claim 66 words
The compiler of claim 59 further including: means for generating code for the constructor when the base class virtually inherits a virtual base class; means for generating code for the virtual function when the virtual function overrides a virtual function defined in the virtual base class; and means for generating code to adjust for differences resulting from the base class virtually inheriting the virtual base class.
Claim 71
Dependent Claim 85 words
The compiler of claim 60 further including: means for generating code for allocating a construction displacement field for the virtual base class; means for generating code for setting the construction displacement field to a value to reflect differences resulting from the base class virtually inheriting the virtual base class; and means for generating code for invoking the overriding virtual function passing a this pointer wherein an adjustor adjusts the this pointer by the value of the construction displacement field before executing the overriding virtual function.
Claim 72
Dependent Claim 21 words
The compiler of claim 61 further including: means for generating code for invoking the overriding virtual function directly from the constructor.
Claim 73
Dependent Claim 30 words
The compiler of claim 61 further including: means for generating code for invoking the overriding virtual function indirectly from the constructor through a function that is invoked by the constructor.
Claim 74
Dependent Claim 15 words
The compiler of claim 61 wherein the derived class does not override the virtual function.
Claim 75
Dependent Claim 15 words
The compiler of claim 60 wherein the derived class does not override the virtual function.
Claim 76
Dependent Claim 24 words
The compiler of claim 60 including means for generating code for adjusting to reflect the occurrence of the base class within the derived class.
Claim 77
Dependent Claim 24 words
The compiler of claim 59 including means for generating code for adjusting to reflect the occurrence of the base class within the derived class.
Claim 78
Independent Claim 154 words
A method in a computer system for accessing a virtual function when constructing a derived object of a derived class, the derived class inheriting a base class, the base class virtually inheriting a virtual base class, the virtual function being defined in the base class to override a virtual function in the virtual base class, the overriding virtual function for accessing an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: adjusting for differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; invoking a constructor of the base class during construction of the derived object; and during execution of the constructor, invoking the overriding virtual function wherein the overriding virtual function correctly accesses the occurrence of the base class within the derived object based on the differences.
Claim 79
Independent Claim 154 words
A method in a computer system for accessing a virtual function when constructing a derived object of a derived class, the derived class inheriting a base class, the base class virtually inheriting a virtual base class, the virtual function being defined in the base class to override a virtual function in the virtual base class, the overriding virtual function for accessing an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: adjusting for differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited; invoking a constructor of the base class during construction of the derived object; and during execution of the constructor, invoking the overriding virtual function wherein the overriding virtual function correctly accesses the occurrence of the base class within the derived object based on the differences.
Claim 80
Dependent Claim 47 words
The method of claim 68 wherein the step of adjusting for differences includes setting a virtual function table for the derived object to an alternate virtual function table, the alternate virtual function table referencing an adjustor to adjust for the differences before invoking the overriding virtual function.
Claim 81
Dependent Claim 41 words
The method of claim 68 including the steps of setting a construction displacement field to a value to reflect the differences and adjusting a this pointer passed to the overriding virtual function based on the value in the construction displacement field.
Claim 82
Independent Claim 116 words
A method in a computer system for constructing an object of a class, the method comprising the computer-implemented steps of: allocating a construction displacement field for the object when the class virtually inherits a base class and when the class has a virtual function that overrides a virtual function in the base class; and during construction of an occurrence of the class when the class is not inherited, setting the construction displacement field to a value to indicate that the class is not inherited; invoking a constructor for the class; and during invocation of the constructor, invoking the overriding virtual function passing a this pointer that is based on the value in the construction placement field.
Claim 83
Independent Claim 116 words
A method in a computer system for constructing an object of a class, the method comprising the computer-implemented steps of: allocating a construction displacement field for the object when the class virtually inherits a base class and when the class has a virtual function that overrides a virtual function in the base class; and during construction of an occurrence of the class when the class is not inherited, setting the construction displacement field to a value to indicate that the class is not inherited; invoking a constructor for the class; and during invocation of the constructor, invoking the overriding virtual function passing a this pointer that is based on the value in the construction placement field.
Claim 84
Dependent Claim 82 words
The method of claim 71 wherein the class is inherited by a derived class and including the steps of: during construction of an occurrence of the class within the derived class, setting the construction displacement field to a value to indicate that the class is inherited by the derived class; invoking the constructor for the class; and during invocation of the constructor, invoking the overriding virtual function passing a this pointer that is based on the value in the construction placement field.
Claim 85
Independent Claim 238 words
A method in a computer system for constructing and destructing a derived object of a derived class, the derived class inheriting a base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: setting a field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited so that during construction of the derived object a constructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class within the derived class based on the setting of the field; setting the field to indicate that construction of the derived object is complete so that when the virtual function is invoked it can correctly access the occurrence of the base class within the derived class based on the setting of the field; and setting the field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited so that during destruction of the derived object a destructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class within the derived class based on the setting of the field.
Claim 86
Independent Claim 238 words
A method in a computer system for constructing and destructing a derived object of a derived class, the derived class inheriting a base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: setting a field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited so that during construction of the derived object a constructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class within the derived class based on the setting of the field; setting the field to indicate that construction of the derived object is complete so that when the virtual function is invoked it can correctly access the occurrence of the base class within the derived class based on the setting of the field; and setting the field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited so that during destruction of the derived object a destructor can invoke the virtual function and the invoked virtual function can correctly access the occurrence of the base class within the derived class based on the setting of the field.
Claim 87
Independent Claim 127 words
A method in a computer system for constructing and destructing a derived object of a derived class, the derived class inheriting a base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: allocating a field for an occurrence of the base class within the derived class; setting the field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited whereby the derived object accesses the occurrence of the base class within the derived class based on the setting of the field when constructing or destructing the derived object.
Claim 88
Independent Claim 127 words
A method in a computer system for constructing and destructing a derived object of a derived class, the derived class inheriting a base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: allocating a field for an occurrence of the base class within the derived class; setting the field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited whereby the derived object accesses the occurrence of the base class within the derived class based on the setting of the field when constructing or destructing the derived object.
Claim 89
Independent Claim 124 words
A method in a computer system for constructing a derived object of a derived class, the derived class inheriting a base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: allocating a field for an occurrence of the base class within the derived class; setting the field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited whereby the derived object access the occurrence of the base class within the derived class based on the setting of the field when constructing or destructing the object.
Claim 90
Independent Claim 124 words
A method in a computer system for constructing a derived object of a derived class, the derived class inheriting a base class having a virtual function that is generated to access an occurrence of the base class when the base class is not inherited, the method comprising the computer-implemented steps of: allocating a field for an occurrence of the base class within the derived class; setting the field to indicate differences between an occurrence of the base class within the derived class and an occurrence of the base class when the base class is not inherited whereby the derived object access the occurrence of the base class within the derived class based on the setting of the field when constructing or destructing the object.

References Cited (Backward Citations)

US5206951A Cited
US5129083A Cited
US5187786A Cited
US5297284A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1997-12-05 1998-06-06 1998-12-06 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2001-12-05 2002-06-06 2002-12-06 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2005-12-05 2006-06-06 2006-12-06 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag