Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
First version of ruby bindings by Medhi
[simgrid.git] / src / bindings / ruby / rb_msg_process.h
1 #ifndef RB_MSG_PROCESS
2 #define RB_MSG_PROCESS
3
4 #include <ruby.h>
5 #include <stdio.h>
6 #include "msg/msg.h"
7 #include "msg/datatypes.h"
8
9 #include "msg/private.h"
10 #include "msg/mailbox.h"
11 #include "surf/surfxml_parse.h"
12 #include "simix/simix.h"
13 #include "simix/private.h"
14 #include "xbt/sysdep.h"        
15 #include "xbt/log.h"
16 #include "xbt/asserts.h"
17
18 #include "rb_msg_host.h"
19
20
21 /**************************************************************************
22 There are 2 section in This File:
23
24 1 - Functions to Manage The Ruby Process  >> Up Call
25 2 - Functions to Manage The Native Process Simulation Bound >> Down Call
26
27 ***************************************************************************/
28
29
30 // Init Ruby : To Call Ruby Methods From C
31
32 static void initRuby();
33
34 /***********************************************
35
36 Functions for Ruby Process Management ( Up Call )
37
38 Independant Methods
39
40 ************************************************/
41
42 // Get Name
43 static VALUE process_getName( VALUE ruby_process );
44
45 // Get  Process ID
46 static VALUE process_getID(VALUE ruby_process);
47
48 // Get Bind : return the ID of Bind member
49 static VALUE process_getBind(VALUE ruby_class);
50
51 // Set Bind 
52 static void process_setBind(VALUE ruby_class,long bind);
53
54 // isAlive
55 static VALUE process_isAlive(VALUE ruby_process);
56
57 // Kill Process
58 static void process_kill(VALUE ruby_process);
59
60 // join Process
61 static void process_join( VALUE ruby_process );
62
63 // unschedule Process
64 static void process_unschedule( VALUE ruby_process );
65
66 // schedule Process
67 static void process_schedule( VALUE ruby_process );
68
69
70
71
72 /***************************************************
73
74 Function for Native Process ( Bound ) Management
75
76 Methods Belong to The MSG Module
77 ****************************************************/
78
79 // ProcessBind Method ; Process Ruby >> Process C
80
81 //friend Method // Not belong to the Class but Called within !!
82 static m_process_t process_to_native(VALUE ruby_process);
83
84 // Binding Process >> Friend Method
85 static void processBind(VALUE ruby_class,m_process_t process);
86
87 // CreateProcess Method
88 static void processCreate(VALUE Class,VALUE rb_process,VALUE host);
89
90 // ProcessSuspend
91 static void processSuspend(VALUE Class,VALUE ruby_process);
92
93 // ProcessResume
94 static void processResume(VALUE Class,VALUE ruby_process);
95
96 //ProcessIsSuspend return Boolean ( Qtrue / Qfalse )
97 static VALUE  processIsSuspend(VALUE Class,VALUE ruby_process);
98
99 //Processkill
100 static void processKill(VALUE Class,VALUE ruby_process);
101
102 //ProcessGetHost
103 static VALUE processGetHost(VALUE Class,VALUE ruby_process);
104
105
106 #endif