摘要
虚函数是C++中实现多态性的一个重要机制,常常使用它在父类中对某种操作提供一个框架,而在不同的子类中为该框架提供不同的实现,据此特点,介绍了目前图形图像处理软件中常用的一种鼠标键盘事件的新的封装机制。该机制以面向对象的多态性及技术基础,可实现鼠标键盘事件的模块化和不同功能间的自动切换。
Virt.ual function is one of the important facilities to support polymorphism in C++, normally the virtual function mechanism is used to provide the frame and the declaration of public methods of some operations for the parent or base class, then the implementation details of the operation would been given in the derived classes individually. With this characteristic, this paper presents a new packaging mechanism which could modulate mouse and keyboard events in graphic and image processing software. On the basis of object-oriented polymorphism technique, the mechanism also can realize automatization of mouse and keyboard and automatic exchange among different events.
出处
《电脑开发与应用》
2006年第5期36-37,共2页
Computer Development & Applications
关键词
虚函数
多态性机制
模块化
消息映射
VC++
virtual function, polymorphism mechanism, automatization, message interaction, VC++