The runtime module API links the GridLAB-D core to modules that are created to perform various modeling tasks. The core interacts with each module according to a set script that determines which exposed module functions are called and when. The general sequence of calls is as follows:
Note that object destruction is not supported at this time.
GridLAB-D modules usually require a number of functions to access data and interaction with the core. These include
Modules | |
| Publishing variables | |
| Modules must register public variables that are accessed by other modules, and the core by publishing them. | |
| Exception handling | |
| Module exception handling is provided for modules implemented in C to perform exception handling, as well to allow C++ code to throw exceptions to the core's main exception handler. | |
| Output functions | |
| Module may output messages to stdout, stderr, and the core test record file using the output functions. | |
| Memory allocation functions | |
| The core is responsible for managing any memory that is shared. | |
| Core access functions | |
| Most module function use core library functions and variables. | |
| Class registration | |
| Class registration is used to make sure the core knows how objects are implemented in modules. | |
| Object management | |
| Object management macros are create to allow modules to create, test, control ranks, and reveal members of objects and registered classes. | |
| Property management | |
| Use the property management functions to provide and gain access to published variables from other modules. | |
| Object search | |
| Searches and navigates object lists. | |
| Random numbers | |
| The random number library provides a variety of random number generations for different distributions. | |
| Time handling functions | |
| Global variables | |
| Locking memory | |
Defines | |
| #define | CDECL |
| #define | EXPORT CDECL |
| #define | EXTERN extern |
| #define | gl_get_oflags (*callback->get_oflags) |
| #define | INIT(X) |
| #define | PADDR(X) ((char*)&(this->X)-(char*)this) |
| The PUBLISH_SET(C,N,E) macro is used to define a keyword for a set variable. | |