Gyoto
|
Listen to me and I'll warn you when I change. More...
#include <GyotoHooks.h>
Public Member Functions | |
Teller () | |
Default constructor. | |
Teller (const Teller &) | |
Copy constructor. | |
virtual | ~Teller () |
Destructor. | |
virtual void | hook (Listener *listener) |
Start listening. More... | |
virtual void | unhook (Listener *listener) |
Stop listening. More... | |
Protected Member Functions | |
virtual void | tellListeners () |
Call tell() on each hooked Listener. More... | |
Private Attributes | |
ListenerItem * | listeners_ |
Linked list of Listener items. | |
Friends | |
class | Gyoto::Hook::Listener |
Listen to me and I'll warn you when I change.
Listen to me by calling my hook() method.
|
virtual |
Start listening.
Use from a Hook::Listener object method:
where "this" is a Listener and "teller" is a Teller.
Use unhook() later to stop listening to a given Teller.
listener | pointer to the new listener |
|
protectedvirtual |
Call tell() on each hooked Listener.
Whenever a Teller mutates, it should warn any Listener hooked to it using tellListeners().
|
virtual |
Stop listening.
Use from a Hook::Listener object method:
where "this" is a Listener, "teller" is a Teller, and "this" has called teller->hook(this) previously.
listener | pointer to the listener |