To use a transient reactor, derive a new class from one of the following base classes:
Monitors a variety of document management events.
Monitors actions associated with long transactions. See Long Transactions.
Monitors creation, modification, and erasure of database objects.
Monitors events related to the layout manager. See Layout Class Overview.
Monitors events pertaining to a specific database object—creation, modification, erasure.
Monitors an extra, entity-specific event, such as modified graphics.
Monitors events related to prompts for user input. See Input Context Events.
Monitors selection set operations.
Monitors ObjectARX application loading and unloading.
Monitors events that are common to both ObjectARX and ObjectDBX ™ .
Monitors AutoCAD-specific events such as commands and AutoLISP ® evaluations.
Monitors events related to the transaction manager—start, abort, or end of a transaction.
Monitors key publish events.
Monitors the Publish Options dialog.
Monitors events through the protocol extension mechanism. See Protocol Reactor Framework.
Monitors Publish to DWF operations.
Monitors children added to, deleted from, or detached from a catalog item.
Monitors changes to Summary Info.
In most cases, only standard C++ techniques are needed for creating new transient reactor classes. The ObjectARX macros, which create a class descriptor object for the new reactor class, are usually not used to derive from these reactor classes.
Each parent class contains a set of virtual notification functions that can be implemented by your newly derived class. For example, the AcDbObjectReactor class contains the following notification functions that respond to object-related events:
Each of these functions requires a pointer to the notifier of the event. The base class, AcDbObjectReactor, has NULL implementations for all of these functions. In your derived reactor class, implement the functions corresponding to the type of notifications you are interested in. Then instantiate the reactor and add it to any number of database objects using the AcDbObject::addReactor() function. To add a transient reactor to or delete it from a notifier object, the object can be open in any state (read, write, or notify). Adding or deleting a transient reactor is not monitored by the undo mechanism. (For persistent reactors, the notifier object must be opened for write, and adding or removing the reactors is monitored by the undo mechanism.) Because you created the transient reactor object, you are also responsible for deleting it.
When an object is erased, for example, it calls the corresponding erased() notification function on each reactor in its list. If you have implemented an erased() function for your reactor, that function is called by the database object, and you can then take whatever special action is appropriate for your application when an object is erased.