Clients can receive change notifications from the Blackboard via this interface. More...
#include <ImNotifiable.h>
Inherited by BaseModule, BaseUtility, SimTracer [private]
, and WorldUtilityStats.
Public Member Functions | |
virtual void | receiveBBItem (int category, const BBItem *details, int scopeModuleId)=0 |
Called by the Blackboard whenever a change of a category occurs to which this client has subscribed. | |
virtual | ~ImNotifiable () |
Prevent compiler complaints, but its best not to use the destructor. |
Clients can receive change notifications from the Blackboard via this interface.
Clients must "implement" (subclass from) this class.
Definition at line 58 of file ImNotifiable.h.
virtual void ImNotifiable::receiveBBItem | ( | int | category, | |
const BBItem * | details, | |||
int | scopeModuleId | |||
) | [pure virtual] |
Called by the Blackboard whenever a change of a category occurs to which this client has subscribed.
If your class is derived from a class that also is notifiable, make sure that you call it first thing you do. E.g.
BaseClass : public ImNotifiable ...
YourClass : public BaseClass ...
YourClass::receiveBBItem(category, details, scopeModuleId) { BaseClass::receiveBBItem(category, details, scopeModuleId); switch(category) { ... } }
This also implies that you should handle unknown categories gracefully -- maybe a subclass subscribed to them.
This function is called from within publishBBItem, please pay attention to race conditions that can appear. If you want to schedule messages when this function of your module is called, you have to use the Enter_Method or the Enter_Method_Silent macro.
Implemented in ChannelAccess, BaseModule, BaseUtility, MoBANLocal, BatteryStats, phyPER, SimTracer, and WorldUtilityStats.