RTTI机制浅析  被引量:1

Analysis of RTTI Realization

在线阅读下载全文

作  者:何洪辉[1] 刘骥宇[2] 

机构地区:[1]河南大学计算中心,河南开封475004 [2]商丘师范学院软件学院,河南商丘476000

出  处:《计算机与现代化》2010年第8期120-123,共4页Computer and Modernization

摘  要:编译结束后,由于C++编译器不再保留类的定义信息,致使程序在运行时刻(Run-Time)无法再次获得对象的类信息,如类名、类的继承关系等,因此C++中的一些重要操作,如动态转类型(dynamic_cast)、对象的持久化(Persistence)等将无法实现,而RTTI正是解决这一问题的关键。鉴于RTTI长期不为大多数开发人员所理解,本文通过对一个简单RT-TI的实现,探讨RTTI的实现机制。After compiling a source file by C++ compiler,the class definition information isn't remained in object file.Therefore,the program at run-time can't acquire the class information,such as class name,class hierarchy and so on,and consequently many operations such as dynamic_cast,persistence are impossible to be completed.RTTI is the key to conquer this problem.Although a great deal of importance is attached to RTTI,many C++ programmers are still confused by RTTI realization.In this paper,a concrete RTTI is realized,and it gives C++ programmers a chance to have a glimpse of RTTI realization.

关 键 词:RTTI 动态类型转换 对象持久化 

分 类 号:TP311.1[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象