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"
13 typedef struct surf_resource_private {
14 /* Share the resources to the actions and return in hom much time
15 the next action may terminate */
16 xbt_heap_float_t(*share_resources) (xbt_heap_float_t now);
17 /* Update the actions' state */
18 void (*update_actions_state) (xbt_heap_float_t now, xbt_heap_float_t delta);
19 void (*update_resource_state) (void *id,tmgr_trace_event_t event_type, xbt_maxmin_float_t value);
20 } s_surf_resource_private_t;
22 /* #define pub2priv(r) ((surf_resource_private_t) ((char *)(r) -(sizeof(struct surf_resource_private_part)))) */
23 /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */
25 /* Generic functions common to all ressources */
26 e_surf_action_state_t surf_action_get_state(surf_action_t action);
27 void surf_action_free(surf_action_t * action);
28 void surf_action_change_state(surf_action_t action, e_surf_action_state_t state);
30 extern xbt_dynar_t resource_list;
31 extern lmm_system_t maxmin_system;
32 extern tmgr_history_t history;
34 #endif /* _SURF_SURF_PRIVATE_H */