|
项目描述: |
The class CObserver is a base class from which you can derive both observer and subject classes. An 'observer' object is one whose internal state depends upon the internal state of one or more other objects. The objects that it depends on are referred to as 'subjects'. The class interface is very simple, having only a few inline functions, one of which is virtual and can be overridden to implement the update function. In spite of its simplicity, it can be used in very powerful ways to keep track of value dependencies and only update values when they are needed and only those values that need updating.
CObserver 是一个基类,从它可以派生观察器(observer)和主题 (subject)类。 'observer'对象的内部状态依赖一个或多个其它对象的内部状态。依赖的对象称为'subjects'。类接口是非常简单的,只有几个内联函数,其中一个是虚拟函数,可以重载来实现更新函数。虽然它简单,但其强大的功能可以用于跟踪值的依赖关系,只在需要的时候更新值,以及只更新需要更新的值。
来源: http://www.codeguru.com/cpp_mfc/virzi_observer.shtml |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
virzi_observer |
 1.0  |
2004-04-09 |
下载 |
|
|