From: coldpeace Date: Mon, 22 Mar 2010 16:27:02 +0000 (+0000) Subject: Host Methods X-Git-Tag: SVN~442 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fe1f35a08a06923fe38c33f3299ac89e56f50998 Host Methods git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7297 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/bindings/ruby/MasterSlave.rb b/src/bindings/ruby/MasterSlave.rb index 848fba2257..7c1ca60a04 100644 --- a/src/bindings/ruby/MasterSlave.rb +++ b/src/bindings/ruby/MasterSlave.rb @@ -79,7 +79,6 @@ if (ARGV.length == 2) else MSG.createEnvironment("platform.xml") MSG.deployApplication("deploy.xml") - end MSG.run diff --git a/src/bindings/ruby/rb_msg_host.c b/src/bindings/ruby/rb_msg_host.c index bab7b71b8c..5320265791 100644 --- a/src/bindings/ruby/rb_msg_host.c +++ b/src/bindings/ruby/rb_msg_host.c @@ -45,17 +45,6 @@ VALUE rb_host_speed(VALUE class,VALUE host) { return MSG_get_host_speed(ht); } -// Host Set Data -void rb_host_set_data(VALUE class,VALUE host,VALUE data) { - THROW_UNIMPLEMENTED; -} - -// Host Get Data -VALUE rb_host_get_data(VALUE class,VALUE host) { - THROW_UNIMPLEMENTED; - return Qnil; -} - // Host is Avail VALUE rb_host_is_avail(VALUE class,VALUE host) { m_host_t ht; diff --git a/src/bindings/ruby/simgrid.rb b/src/bindings/ruby/simgrid.rb index c618f33a61..1fcab4facc 100644 --- a/src/bindings/ruby/simgrid.rb +++ b/src/bindings/ruby/simgrid.rb @@ -133,7 +133,7 @@ end class MSG::Task < MSG::RbTask def initialize(*args) - super() + super() end def setData(value) @@ -145,7 +145,7 @@ class MSG::Task < MSG::RbTask end def name - super(self) + super(self) end def compSize @@ -189,6 +189,21 @@ end # Host Extend from the native Class RbHost #################################################### class MSG::Host < MSG::RbHost + + attr_reader :data + def initialize(*ars) + @data = 1 + p "Host Initializer" + end + + def data() + return @data + end + + def setData(value) + @data = value + end + def getByName(name) super(name) end @@ -205,9 +220,6 @@ class MSG::Host < MSG::RbHost super(self) end - def setData(data) - super(self,data) - end def isAvail super(self) diff --git a/src/bindings/ruby/simgrid_ruby.c b/src/bindings/ruby/simgrid_ruby.c index 74fba1d147..1840534167 100644 --- a/src/bindings/ruby/simgrid_ruby.c +++ b/src/bindings/ruby/simgrid_ruby.c @@ -136,7 +136,6 @@ static VALUE msg_get_clock(VALUE class) { } - extern const char*xbt_ctx_factory_to_use; /*Hack: let msg load directly the right factory */ typedef VALUE(*rb_meth)(ANYARGS); @@ -189,8 +188,6 @@ void Init_simgrid_ruby() { rb_define_module_function(rb_host,"name",(rb_meth)rb_host_name,1); rb_define_module_function(rb_host,"speed",(rb_meth)rb_host_speed,1); rb_define_module_function(rb_host,"number",(rb_meth)rb_host_number,0); - rb_define_module_function(rb_host,"setData",(rb_meth)rb_host_set_data,2); - rb_define_module_function(rb_host,"getData",(rb_meth)rb_host_get_data,1); rb_define_module_function(rb_host,"isAvail",(rb_meth)rb_host_is_avail,1); rb_define_module_function(rb_host,"getHostProcess",(rb_meth)rb_host_process,1); } \ No newline at end of file