Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Host Methods
authorcoldpeace <coldpeace@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 22 Mar 2010 16:27:02 +0000 (16:27 +0000)
committercoldpeace <coldpeace@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 22 Mar 2010 16:27:02 +0000 (16:27 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7297 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/bindings/ruby/MasterSlave.rb
src/bindings/ruby/rb_msg_host.c
src/bindings/ruby/simgrid.rb
src/bindings/ruby/simgrid_ruby.c

index 848fba2..7c1ca60 100644 (file)
@@ -79,7 +79,6 @@ if (ARGV.length == 2)
 else 
        MSG.createEnvironment("platform.xml")
        MSG.deployApplication("deploy.xml")
-
 end
 
 MSG.run
index bab7b71..5320265 100644 (file)
@@ -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;
index c618f33..1fcab4f 100644 (file)
@@ -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)
index 74fba1d..1840534 100644 (file)
@@ -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