Gyoto::Hook::Teller Class Reference

Listen to me and I'll warn you when I change. More...

`#include <GyotoHooks.h>`

Inheritance diagram for Gyoto::Hook::Teller:

## Public Member Functions

| Teller ()
| Default constructor.
| Teller (const Teller &)
| Copy constructor.
virtual | ~Teller ()
| Destructor.
virtual void | hook (Listener *listener)
| Start listening.
virtual void | unhook (Listener *listener)
| Stop listening.

## Protected Member Functions

virtual void | tellListeners ()
| Call tell() on each hooked Listener.

## Private Attributes

ListenerItem * | listeners_
| Linked list of Listener items.

## Friends

class | Gyoto::Hook::Listener

## Detailed Description

Listen to me and I'll warn you when I change.

Listen to me by calling my hook() method.

## Member Function Documentation

## hook()

virtual void Gyoto::Hook::Teller::hook | ( | Listener * | listener | ) |

virtual

Start listening.

Use from a Hook::Listener object method:

teller->hook(this)

where "this" is a Listener and "teller" is a Teller.

Use unhook() later to stop listening to a given Teller.

Parameters

  listener | pointer to the new listener

## tellListeners()

virtual void Gyoto::Hook::Teller::tellListeners | ( |  | ) |

protected virtual

Call tell() on each hooked Listener.

Whenever a Teller mutates, it should warn any Listener hooked to it using tellListeners().

## unhook()

virtual void Gyoto::Hook::Teller::unhook | ( | Listener * | listener | ) |

virtual

Stop listening.

Use from a Hook::Listener object method:

teller->unhook(this)

where "this" is a Listener, "teller" is a Teller, and "this" has called teller->hook(this) previously.

Parameters

  listener | pointer to the listener

The documentation for this class was generated from the following file:

- GyotoHooks.h