IResponder is used to recieve a Signal.
The Signal/Responder protocol is used particularly for broadcasting model changes, but is used anytime the listener doesn't care what object changed, but is intererested in finding out about all changes of a certain class. IResponder is implemented in order to receive a message. The IReponder implementation can be added to any boss, but since the SignalMgr uses the ServiceID to locate the responder, the responder's boss will have to also have an
- See Also
- IK2ServiceProvider implementation that uses the serviceID of the message type. Typically a responder that handles a single type of message can use kResponderServiceProviderImpl for the IK2ServiceProvider. Note that the threading policy for a responder is dictated by the threading policy of the service provider it is associated with (
- IK2ServiceProvider::GetThreadingPolicy comments). All implementations of IResponder should inherit from CResponder.
- CResponder
- ISignalMgr
| virtual void IResponder::Respond | ( | ISignalMgr * | signalMgr | ) | |
| pure virtual |
Respond to the signal. If there's an error, set the global error state to cancel the associated action. If you have one responder that depends on another responder having already been signalled, use the SignalMgr::SignalResponder to signal the other responder. The SignalMgr will call the other responder immediately, and will know later on that that responder has already been called. The responder may find it handy to query the signalMgr for a data interface that contains more information about the action.
- Parameters
| signalMgr | the signalMgr that sent the signal |
Implemented in GTTxtEdtResponder, PstLstPhase2Conversion, LnkWtchDocResponder, CusCondTxtResponder, PstLstDocResponder, BscTADocResponder, FrmlLblResponder, CusDtLnkDocResponder, BPIDefaultResponder, IDHAResponder, DocWchResponder, TranFxResponder, CusDtLnkLinkResponder, CusDtLnkPhase2Conversion, and CResponder.
| virtual void IResponder::SignalFailed | ( | ISignalMgr * | signalMgr | ) | |
| pure virtual |
Handle errors that come up during signalling. If the action has been cancelled, and the reponder has already been called, the SignalMgr will call the reponder again, to let it know that the action is cancelled. For instance, suppose that there are 14 observers, and 10 have been called when the eleventh sets the error state. Then the remaining three are not called, and the first 10's SignalError get called. If the responder has attached observers, these should be detached here.
- Parameters
| signalMgr | the signalMgr that sent the signal |
Implemented in CResponder.