3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #ifndef _SURF_SURF_PRIVATE_H
9 #define _SURF_SURF_PRIVATE_H
11 #include "surf/surf.h"
12 #include "surf/maxmin.h"
13 #include "surf/trace_mgr.h"
15 #include "surf/surf_parse.h"
17 typedef struct surf_resource_private {
18 int (*resource_used)(void *resource_id);
19 /* Share the resources to the actions and return in hom much time
20 the next action may terminate */
21 xbt_heap_float_t(*share_resources) (xbt_heap_float_t now);
22 /* Update the actions' state */
23 void (*update_actions_state) (xbt_heap_float_t now, xbt_heap_float_t delta);
24 void (*update_resource_state) (void *id,tmgr_trace_event_t event_type, xbt_maxmin_float_t value);
25 void (*finalize)(void);
26 } s_surf_resource_private_t;
28 /* #define pub2priv(r) ((surf_resource_private_t) ((char *)(r) -(sizeof(struct surf_resource_private_part)))) */
29 /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */
31 /* Generic functions common to all ressources */
32 e_surf_action_state_t surf_action_get_state(surf_action_t action);
33 void surf_action_free(surf_action_t * action);
34 void surf_action_change_state(surf_action_t action, e_surf_action_state_t state);
36 extern xbt_dynar_t resource_list;
37 extern lmm_system_t maxmin_system;
38 extern tmgr_history_t history;
40 #endif /* _SURF_SURF_PRIVATE_H */