class Observer |
|
The interface for reacting on monitored or replayed changes.
The Observer provides an interface to react on monitored or replayed changes. Since the this base class does only tell the change recorder that the change has been processed, an AgentBase subclass which wants to actually process the change needs to subclass Observer and reimplement the methods it is interested in. Such an agent specific Observer implementation can either be done stand-alone, i.e. as a separate object, or by inheriting both AgentBase and AgentBase.Observer. The observer implementation then has registered with the agent, so it can forward the incoming changes to the observer. In the multiple inheritance approach the init() method automatically registers itself as the observer. Example for stand-alone observer: class ExampleAgent : public AgentBase { public: ExampleAgent( const QString &id ); Example for observer through multiple inheritance: class ExampleAgent : public AgentBase, public AgentBase.Observer { public: ExampleAgent( const QString &id );
Author Kevin Krammer |
|
Creates an observer instance. |
|
Reimplement to handle adding of new collections.
collection - The newly added collection. parent - The parent collection. |
|
Reimplement to handle changes to existing collections.
collection - The changed collection. |
|
Reimplement to handle deletion of collections.
collection - The deleted collection. |
|
Reimplement to handle adding of new items.
item - The newly added item. collection - The collection item got added to. |
|
Reimplement to handle changes to existing items.
item - The changed item. partIdentifiers - The identifiers of the item parts that has been changed. |
|
Reimplement to handle deletion of items.
item - The deleted item. |