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 #include "host_private.h"
8 surf_host_resource_t surf_host_resource = NULL;
10 static void parse_file(const char *file)
14 static void *name_service(const char *name)
19 static surf_action_t action_new(void *callback)
24 static e_surf_action_state_t action_get_state(surf_action_t action)
26 return SURF_ACTION_NOT_IN_THE_SYSTEM;
29 static void action_free(surf_action_t * action)
34 static void action_cancel(surf_action_t action)
39 static void action_recycle(surf_action_t action)
44 static void action_change_state(surf_action_t action, e_surf_action_state_t state)
49 static xbt_heap_float_t share_resources(void)
54 static void solve(xbt_heap_float_t date)
59 static void execute(void *host, xbt_maxmin_float_t size, surf_action_t action)
63 static e_surf_host_state_t get_state(void *host)
69 surf_host_resource_t surf_host_resource_init(void)
71 surf_host_resource = xbt_new0(s_surf_host_resource_t,1);
73 surf_host_resource->resource.parse_file = parse_file;
74 surf_host_resource->resource.name_service = name_service;
75 surf_host_resource->resource.action_new=action_new;
76 surf_host_resource->resource.action_get_state=surf_action_get_state;
77 surf_host_resource->resource.action_free = action_free;
78 surf_host_resource->resource.action_cancel = action_cancel;
79 surf_host_resource->resource.action_recycle = action_recycle;
80 surf_host_resource->resource.action_change_state = action_change_state;
81 surf_host_resource->resource.share_resources = share_resources;
82 surf_host_resource->resource.solve = solve;
84 surf_host_resource->execute = execute;
85 surf_host_resource->get_state = get_state;
87 return surf_host_resource;