1 /* Authors: Arnaud Legrand */
3 /* This program is free software; you can redistribute it and/or modify it
4 under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef _SURF_SURF_PRIVATE_H
7 #define _SURF_SURF_PRIVATE_H
10 #include "surf/maxmin.h"
11 #include "surf/trace_mgr.h"
14 typedef struct surf_resource_private {
15 /* Share the resources to the actions and return in hom much time
16 the next action may terminate */
17 xbt_heap_float_t(*share_resources) (xbt_heap_float_t now);
18 /* Update the actions' state */
19 void (*update_actions_state) (xbt_heap_float_t now, xbt_heap_float_t delta);
20 void (*update_resource_state) (void *id,tmgr_trace_event_t event_type, xbt_maxmin_float_t value);
21 void (*finalize)(void);
22 } s_surf_resource_private_t;
24 /* #define pub2priv(r) ((surf_resource_private_t) ((char *)(r) -(sizeof(struct surf_resource_private_part)))) */
25 /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */
27 /* Generic functions common to all ressources */
28 e_surf_action_state_t surf_action_get_state(surf_action_t action);
29 void surf_action_free(surf_action_t * action);
30 void surf_action_change_state(surf_action_t action, e_surf_action_state_t state);
32 extern xbt_dynar_t resource_list;
33 extern lmm_system_t maxmin_system;
34 extern tmgr_history_t history;
36 #endif /* _SURF_SURF_PRIVATE_H */