发明名称 Run-time type conversion
摘要 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.
申请公布号 US8327346(B2) 申请公布日期 2012.12.04
申请号 US20080244100 申请日期 2008.10.02
申请人 AGRAWAL SACHIN O.;INTERNATIONAL BUSINESS MACHINES CORPORATION 发明人 AGRAWAL SACHIN O.
分类号 G06F9/44 主分类号 G06F9/44
代理机构 代理人
主权项
地址