From GridLAB-D Wiki
Notifications - Procedure to obtain object/property change notifications
Synopsis
- module/class.h
#include "gridlabd.h" EXPORT_NOTIFY(class); EXPORT_NOTIFY_PROP(class,property); int class::prenotify(PROPERTY *prop, char *value); int class::postnotify(PROPERTY *prop, char *value);
Description
Whenever a property is changed using the module API, a notification is sent to any class that has registered a notifier. If the property notification is used, the notification message will only be sent when the specified property is changed.
Return value
The notifier returns 0 is the notification is not handled and non-zero if it is handled.
Issues
GridLAB-D does not mandate using accessors to write properties of objects. As a result, the core cannot guarantee that all changes to object properties will result in notifications.
See also
- Guide to Programming GridLAB-D
- Introduction
- Creating a module
- Creating a class
- Special Topics
- Source documentation
- Validation
- Debugging
- Code templates