This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | updaterfunc_t |
Structure describing an updater function. More... | |
Typedefs | |
typedef int(*) | updater_f (int src, int dst, int typeid, int resid) |
Pointer to an updater function. | |
typedef updaterfunc_t | updaterfunc |
Functions | |
int | updater_reorder () |
Reorders dep_updaterlist linked list. | |
int | updater_check (int dst, int typeid) |
Checks if an updater function has been registered that has dst as a destination event. | |
updaterfunc * | updater_new (int src, int dst, int typeid, updater_f func) |
Register a new updater function. | |
int | updater_call (updaterfunc *updater, int resid) |
Calls an updater function. | |
void | updater_call_all (table *tab) |
Calls all registered updater functions. | |
int | updater_fix_domains () |
Fixes resource domains when updater functions are used. |
typedef int(*) updater_f(int src, int dst, int typeid, int resid) |
Pointer to an updater function.
Updater function updates the assignment of one or more variable resources to an dependent event in a timetable structure.
The variable resources it assigns to this event depend on which variable resources have been assigned to a different, independent event.
src | Tuple ID of the independent event. | |
dst | Tuple ID of the dependent event. | |
typeid | Resource type ID this updater function changes. | |
tab | Pointer to the timetable structure. |
int updater_call | ( | updaterfunc * | updater, | |
int | resid | |||
) |
Calls an updater function.
updater | Pointer to the updater function to be called. | |
resid | Resource ID of the resource of the correct type that is assigned to the source tuple of the updater function. |
void updater_call_all | ( | table * | tab | ) |
Calls all registered updater functions.
Functions are called in the order of the linked list. updater_reorder() must be called before the first call to updater_call_all() to properly reorder the linked list.
tab | Pointer to the timetable structure. |
int updater_check | ( | int | dst, | |
int | typeid | |||
) |
Checks if an updater function has been registered that has dst as a destination event.
If no such updater function has been registered, this means that it is safe to register a new updater function with dst as a destination event.
dst | Tuple ID of the event to check. | |
typeid | Resource type ID to check. |
int updater_fix_domains | ( | ) |
Fixes resource domains when updater functions are used.
If no updater functions are used this function has no effect.
If updater functions are used in a problem description, the source tuples of updater functions must have their resource domains checked if any value in them causes the updater function to set a resource in the destination tuple outside its domain.
This function changes the resource domains of tuples so that this can not happen.
This function must be called after updater_reorder() and before data_init().
updaterfunc* updater_new | ( | int | src, | |
int | dst, | |||
int | typeid, | |||
updater_f | func | |||
) |
Register a new updater function.
It is recommended that updater_check() is called before calling this function to verify if there isn't another updater function registered for this dependent event.
src | Tuple ID of the independent event. | |
dst | Tuple ID of the dependent event. | |
typeid | Resource type ID this updater function changes. | |
func | Pointer to the updater function. |
int updater_reorder | ( | ) |
Reorders dep_updaterlist linked list.
A source (independent) event for an updater function can infact be a destination (dependent) event of another updater function. This means that updater functions must be called in the correct order.
Example: Function A has a source event 2 and destination event 3. Function B has a source event 1 and destination event 2. In this case updater_reorder() puts function B in front of A.