1 /* Copyright (c) 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 //#include "ruby_simdag.h"
8 #include "rb_SD_workstation.h"
11 static void SD_workstation_free(SD_workstation_t wrk)
16 static VALUE rb_SD_workstation_list(VALUE class)
20 nb = SD_workstation_get_number();
21 VALUE workstation_list = rb_ary_new2(nb);
25 wrk = Data_Wrap_Struct(class, 0, SD_workstation_free, SD_workstation_get_list()[i]);
26 rb_ary_push(workstation_list,wrk);
29 return workstation_list;
33 static VALUE rb_SD_workstation_number(VALUE class)
35 int nb = SD_workstation_get_number();
40 static VALUE rb_SD_workstation_name(VALUE class,VALUE workstation)
43 Data_Get_Struct(workstation, SD_workstation_t, wk);
44 return rb_str_new2(SD_workstation_get_name(wk));