src/observer.c File Reference

#include <stdio.h>
#include "mb_redraw_man.h"
#include "mb_observer.h"
#include "mb_tools.h"

Go to the source code of this file.

Defines

#define ASSERT(x)

Functions

subject_tsubject_new (ob_factory_t *factory, void *obj, int obj_type)
void subject_free (ob_factory_t *factory, subject_t *subject)
void subject_notify (ob_factory_t *factory, subject_t *subject, event_t *evt)
observer_tsubject_add_observer (ob_factory_t *factory, subject_t *subject, evt_handler hdr, void *arg)
void subject_remove_observer (ob_factory_t *factory, subject_t *subject, observer_t *observer)


Define Documentation

#define ASSERT (  ) 

Definition at line 7 of file observer.c.


Function Documentation

observer_t* subject_add_observer ( ob_factory_t factory,
subject_t subject,
evt_handler  hdr,
void *  arg 
)

Definition at line 79 of file observer.c.

void subject_free ( ob_factory_t factory,
subject_t subject 
)

Todo:
Keep ob_factory following subject objects.

Definition at line 28 of file observer.c.

subject_t* subject_new ( ob_factory_t factory,
void *  obj,
int  obj_type 
)

Definition at line 10 of file observer.c.

void subject_notify ( ob_factory_t factory,
subject_t subject,
event_t evt 
)

Note:
What is happend when the subject is freed by observer? Postponding the request of free until notification been finished. (SUBF_BUSY / SUBF_FREE)

Definition at line 48 of file observer.c.

void subject_remove_observer ( ob_factory_t factory,
subject_t subject,
observer_t observer 
)

Definition at line 95 of file observer.c.

SourceForge.net Logo