Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge commit '045db1657e870c721be490b411868f4181a12ced' into surf++
[simgrid.git] / src / include / surf / surf_resource.h
1
2 /* Copyright (c) 2009-2013. The SimGrid Team.
3  * All rights reserved.                                                     */
4
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. */
7
8 #include "surf/surf.h"
9 #ifndef SURF_RESOURCE_H
10 #define SURF_RESOURCE_H
11
12 /*FIXME:DELETEstatic XBT_INLINE
13     surf_resource_t surf_resource_new(size_t childsize,
14                                       surf_model_t model, const char *name,
15                                       xbt_dict_t props, void_f_pvoid_t free_f)
16 {
17   surf_resource_t res = xbt_malloc0(childsize);
18   res->model = model;
19   res->name = xbt_strdup(name);
20   res->properties = props;
21   res->free_f=free_f;
22   return res;
23 }
24
25 static XBT_INLINE void surf_resource_free(void *r)
26 {
27   surf_resource_t resource = r;
28   if(resource->free_f)
29     resource->free_f(r);
30   free(resource->name);
31   xbt_dict_free(&resource->properties);
32   free(resource);
33 }
34
35 static XBT_INLINE const char *surf_resource_name(const void *resource)
36 {
37   return ((surf_resource_t) resource)->name;
38 }
39
40 static XBT_INLINE xbt_dict_t surf_resource_properties(const void *resource)
41 {
42   return ((surf_resource_t) resource)->properties;
43 }*/
44
45 #endif                          /* SURF_RESOURCE_H */