Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Almost Done ... Still Stuckin' Wiith Some MSG Error while The Slave Should Recieve ...
[simgrid.git] / src / bindings / ruby / ProcessFactory.rb
index ca34bd3..d31365f 100644 (file)
@@ -1,3 +1,12 @@
+# 
+#  * $Id$
+#  *
+#  * Copyright 2010 Martin Quinson, Mehdi Fekari           
+#  * All right reserved. 
+#  *
+#  * This program is free software; you can redistribute 
+#  * it and/or modify it under the terms of the license 
+#  *(GNU LGPL) which comes with this package. 
 require 'RubyProcess'
 require 'RubyHost'
 class ProcessFactory 
 require 'RubyProcess'
 require 'RubyHost'
 class ProcessFactory 
@@ -15,7 +24,6 @@ class ProcessFactory
     end
     
 #     setProcessIdentity
     end
     
 #     setProcessIdentity
-    
     def setProcessIdentity(hostName,function)
       @hostName = hostName
       @function = function
     def setProcessIdentity(hostName,function)
       @hostName = hostName
       @function = function
@@ -30,28 +38,25 @@ class ProcessFactory
     
     end
 
     
     end
 
-#     RegisterProcess
-    
-    def registerProcessArg( arg )
+#     RegisterProcess  
+    def registerProcessArg(arg)
       
       
-      args.push(arg)
+      @args.push(arg)
       
     end
 
 #     CreateProcess
     def createProcess()
       
       
     end
 
 #     CreateProcess
     def createProcess()
       
-      process = rubyNewInstance(@function) 
-#       process = rubyNewInstanceArgs(@function,@args)
-      
-      process.name = @function
-      process.id = process.nextId() # This increment Automaticly  The Static ProcessNextId for The Class RbProces
-#       host = RbHost.getByName(@hostName)
-#       Process.createProcess(process,host)
+      process = rubyNewInstance(@function) #process = rubyNewInstanceArgs(@function,@args) #
       size = @args.size
       for i in 0..size-1
       size = @args.size
       for i in 0..size-1
-       process.pargs.push(@args[i])
+       process.pargs.push(@args[i]) 
       end
       end
+      process.name = @function
+      process.id = process.nextId() # This increment Automaticly  The Static ProcessNextId for The Class RbProces
+      host = RbHost.getByName(@hostName)
+      processCreate(process,host)
       process.proprieties = @proprieties
       @proprieties = Hash.new
       
       process.proprieties = @proprieties
       @proprieties = Hash.new
       
@@ -59,9 +64,7 @@ class ProcessFactory
     
 #     SetProperty
     def setProperty(id,value)
     
 #     SetProperty
     def setProperty(id,value)
-      
       @proprieties[id] = value
       @proprieties[id] = value
-      
     end
     
 #     End Class
     end
     
 #     End Class