数据库中对象事件通知反应器 例如:
//从该类继一个自己的类 class IntelliRealTimeZoomObjectReactor : public McDbObjectReactor { public: virtual void openedForModify(const McDbObject* dbObj); static IntelliRealTimeZoomObjectReactor s_reactor; }; // IntelliRealTimeZoomObjectReactor IntelliRealTimeZoomObjectReactor::s_reactor; void IntelliRealTimeZoomObjectReactor::openedForModify(const McDbObject* dbObj) { McApDocument* pDoc = dbObj->database()->GetDocument(); if(pDoc != NULL) { IntelliRealTimeZoom* pRealTimZoom = IntelliCmdDocDataContainer::Instance().docData(pDoc)->RealTimeZoom(); pRealTimZoom->ReSetData(); } } // 调用McDbObject::addReactor,注册反应器 spViewport->addReactor(&(IntelliRealTimeZoomObjectReactor::s_reactor) ); // 调用McDbObject::removeReactor(),注消反应器 spViewport->removeReactor(&(IntelliRealTimeZoomObjectReactor::s_reactor) );
class McDbObjectReactor : public McRxObject;
dbmain.h