Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 509 Bytes

readme.md

File metadata and controls

20 lines (14 loc) · 509 Bytes

C Observer

basic implementation of Observer Pattern in C.

How to run

gem install ceedling
ceedling test:observer

How to use

To add Observable property to certain object,

  1. Place Observable type as the first field of your sturct.
  2. Call Observable_init to activate
  3. If some module wants to be notified, register appropriate handler with Observable_attach
  4. Now that will make anything can be updated when Observable_notify called.

See test/test_observable.c for example.