Invention Grant
- Patent Title: Run-time type conversion
- Patent Title (中): 运行时类型转换
-
Application No.: US12244100Application Date: 2008-10-02
-
Publication No.: US08327346B2Publication Date: 2012-12-04
- Inventor: Sachin O. Agrawal
- Applicant: Sachin O. Agrawal
- Applicant Address: US NY Armonk
- Assignee: International Business Machines Corporation
- Current Assignee: International Business Machines Corporation
- Current Assignee Address: US NY Armonk
- Agency: Schmeiser, Olsen & Watts
- Agent John Pivnichny
- Main IPC: G06F9/44
- IPC: G06F9/44

Abstract:
A method, system and computer program product for converting a class (i.e., type) of an object from a first class to a second class. Multiple classes, class layouts, and an object layout are received. A first class layout references a first virtual function table (v-table) that defines behaviors of the first class. A second class layout references a second v-table that defines behaviors of the second class. The object layout includes a reference to the first v-table to define runtime behaviors of the object as the behaviors of the first class. At runtime, the reference in the object layout is modified to reference the second v-table to update the object's runtime behaviors to the behaviors of the second class, thereby converting the object from the first class to the second class without changing to an object layout memory address or to any class layout.
Public/Granted literature
- US20090031285A1 RUN-TIME TYPE CONVERSION Public/Granted day:2009-01-29
Information query