TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Notifications.h File Reference
#include <stdint.h>
#include "temu-c/Support/Attributes.h"
Include dependency graph for Notifications.h:

Go to the source code of this file.

Typedefs

typedef void(* temu_NotificationHandler )(void *Arg, void *Source, void *NotInfo)
 

Functions

TEMU_API int64_t temu_publishNotification (const char *NotName, void *Obj)
 
TEMU_API int temu_subscribeNotification (const char *NotName, void *Source, void *Arg, temu_NotificationHandler NotFunc)
 
TEMU_API int temu_unsubscribeNotification (const char *NotName, void *Source, temu_NotificationHandler NotFunc)
 
TEMU_API int temu_unsubscribeNotificationArg (const char *NotName, void *Source, temu_NotificationHandler NotFunc, void *Arg)
 
TEMU_API void temu_notify (int64_t Id, void *NotInfo)
 

Typedef Documentation

typedef void(* temu_NotificationHandler)(void *Arg, void *Source, void *NotInfo)

Definition at line 28 of file Notifications.h.

Function Documentation

TEMU_API void temu_notify ( int64_t  Id,
void *  NotInfo 
)

Call event subscriber, EvInfo is a per event specific struct the event handler must cast this to the appropriate type.

Parameters
IdNotification ID
NotInfoPonter to pass to notification handlers
TEMU_API int64_t temu_publishNotification ( const char *  NotName,
void *  Obj 
)

Publish a notification source A notification source is identified by an event name and an object pointer

Parameters
NotNameName of the notification
ObjPointer to the object
Returns
Notification ID of the published event.
TEMU_API int temu_subscribeNotification ( const char *  NotName,
void *  Source,
void *  Arg,
temu_NotificationHandler  NotFunc 
)

Install notification functions for the given event generated by source

Parameters
NotNameName of the notification
SourceIf source is NULL, the event subscriber will be notified by all the sources for the given name.
ArgContext argument to be passed to the callback notification function
NotFuncThe callback function on notification
TEMU_API int temu_unsubscribeNotification ( const char *  NotName,
void *  Source,
temu_NotificationHandler  NotFunc 
)

Remove notification handler for the given name and source. Note that this function runs in O(N) time. It is not meant for being used in performance critical code.

Parameters
NotNameName of the notification
SourceIf source is NULL, the event subscriber will be notified by all the sources for the given name.
NotFuncThe callback function to be called on notification
TEMU_API int temu_unsubscribeNotificationArg ( const char *  NotName,
void *  Source,
temu_NotificationHandler  NotFunc,
void *  Arg 
)

Remove notification handler for the given name, source and arg. Note that this function runs in O(N) time. It is not meant for being used in performance critical code.

Parameters
NotNameName of the notification
SourceIf source is NULL, the event subscriber will be notified by all the sources for the given name.
NotFuncThe callback function to be called on notification
ArgContext argument to be passed to the callback notification function
Returns
zero on success, otherwise non-zero