Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
"new ruby host method"
[simgrid.git] / src / cxx / MsgProcess.hpp
1 /*
2  * Process.hpp
3  *
4  * Copyright 2006,2007 Martin Quinson, Malek Cherier           
5  * All right reserved. 
6  *
7  * This program is free software; you can redistribute 
8  * it and/or modify it under the terms of the license 
9  *(GNU LGPL) which comes with this package. 
10  *
11  */  
12  
13 #ifndef MSG_PROCESS_HPP
14 #define MSG_PROCESS_HPP
15
16 // Compilation C++ recquise
17 #ifndef __cplusplus
18         #error Process.hpp requires C++ compilation (use a .cxx suffix)
19 #endif
20
21 #include <msg/datatypes.h>
22
23 #include <MsgApplicationHandler.hpp>
24 #include <Object.hpp>
25
26 #include <MsgException.hpp>
27 #include <NullPointerException.hpp>
28 #include <HostNotFoundException.hpp>
29 #include <ProcessNotFoundException.hpp>
30 #include <InvalidArgumentException.hpp>
31 #include <BadAllocException.hpp>
32 #include <LogicException.hpp>
33
34 namespace SimGrid
35 {
36         namespace Msg
37         {
38                 class ApplicationHandler;
39                 class Host;
40                 class Task;
41
42                 // SimGrid::Msg::Process class declaration.
43                 class SIMGRIDX_EXPORT Process : public Object
44                 {
45                         friend class ApplicationHandler::ProcessFactory;
46                         
47                         MSG_DECLARE_DYNAMIC(Process);
48
49                         public:
50
51                                 // Disable the default constructor.
52                                 Process();
53                         
54                         
55                                 /*! \brief  Constructs a process from the name of the host and its name.
56                                  *
57                                  * \param hostName              The host name of the process to create.
58                                  * \param name                  The name of the process to create.
59                                  *
60                                  * \exception                   If the constructor failed, it throws one of the exceptions described
61                                  *                                              below:
62                                  *                                              
63                                  *                                              [NullPointerException]          if the name of the process is NULL or if the
64                                  *                                                                                                      name of the host is NULL.
65                                  *                                              [HostNotFoundException]         if the host is not found.
66                                  */     
67                                 Process(const char* hostName, const char* name)
68                                 throw(NullPointerException, HostNotFoundException, BadAllocException);
69                         
70                                 /*! \brief Constructs a process from a reference to an host object and its name.
71                                  *
72                                  * \param rHost                 A reference to the host object representing the native
73                                  *                                              MSG host where to create the process.
74                                  * \param name                  The name of the process to create.
75                                  *
76                                  * \exception                   If the constructor failed, it throws the exception described
77                                  *                                              below:
78                                  *
79                                  *                                              [NullPointerException]          if the name of process is NULL.
80                                  */ 
81                                 Process(const Host& rHost, const char* name)
82                                 throw(NullPointerException);
83                                 
84                                 /*! brief Construct a proces from reference to an host object and the name of the process.
85                                  * This constuctor takes also the list of the arguments of the process.
86                                  *
87                                  * \param host                  A reference to the host where to create the process.
88                                  * \param name                  The name of the process to create.
89                                  * \param argc                  The number of the arguments of the process to create.
90                                  * \param argv                  The list of arguments of the process to create.
91                                  *
92                                  * \exception                   If the constructor failed, it throws one of the exceptions described
93                                  *                                              below:
94                                  *
95                                  *                                              [NullPointerException]          if the name of the host is NULL or
96                                  *                                                                                                      if the name of the process is NULL.
97                                  *                                              [InvalidArgumentException]  if the value of the parameter argv is
98                                  *                                                                                                      negative.
99                                  *                                              [LogicException]                        if the parameter argv is NULL and the 
100                                  *                                                                                                      parameter argc is different than zero
101                                  *                                                                                                      if the parameter argv is not NULL and 
102                                  *                                                                                                      the parameter argc is zero.
103                                  */
104                                 Process(const Host& rHost, const char* name, int argc, char** argv)
105                                 throw(NullPointerException, InvalidArgumentException, LogicException);
106                                 
107                                 /*! brief Constructs a proces from the name of a host and the name of the process.
108                                  * This constuctor takes also the list of the arguments of the process.
109                                  *
110                                  * \param hostName              The name of the host where to create the process.
111                                  * \param name                  The name of the process to create.
112                                  * \param argc                  The number of the arguments of the process to create.
113                                  * \param argv                  The list of arguments of the process to create.
114                                  *
115                                  * \exception                   If the constructor failed, it throws one of the exceptions described
116                                  *                                              below:
117                                  *                                              
118                                  *                                              [NullPointerException]          if the name of the process or if the name
119                                  *                                                                                                      of the host is NULL.
120                                  *                                              [InvalidArgumentException]  if the value of the parameter argv is
121                                  *                                                                                                      negative.
122                                  *                                              [LogicException]                        if the parameter argv is NULL and the 
123                                  *                                                                                                      parameter argc is different than zero
124                                  *                                                                                                      if the parameter argv is not NULL and 
125                                  *                                                                                                      the parameter argc is zero.
126                                  *                                              [HostNotFoundException]         if the specified host is no found.
127                                  */
128                                 Process(const char* hostName, const char* name, int argc, char** argv)
129                                 throw(NullPointerException, InvalidArgumentException, LogicException, HostNotFoundException, BadAllocException);
130                         
131                                 /*! \brief Process::killAll() - kill all the running processes of the simulation.
132                                  *
133                                  * \param resetPID              Should we reset the PID numbers. A negative number means no reset
134                          *                                              and a positive number will be used to set the PID of the next newly
135                          *                                              created process.
136                          *
137                          * \return                              The static method returns the PID of the next created process.
138                          */                     
139                                 static int killAll(int resetPID);
140                         
141                                 /*! \brief Process::suspend() - Suspend an MSG process.
142                                  * 
143                                  * \excetpion                   If this method failed, it throws one the exception described below:
144                                  *
145                                  *                                              [MsgException]  if an internal exception occurs during the operation.
146                                  */
147                                 void suspend(void)
148                                 throw(MsgException);
149                                 
150                                 
151                         
152                                 /*! \brief Process::resume() - Resume the MSG process.
153                                  *
154                                  * \exception                   If this method failed, it throws the exception described below:
155                                  *
156                                  *                                              [MsgException] if an internal exception occurs during the operation.
157                                  */
158                                 void resume(void) 
159                                 throw(MsgException);
160                         
161                                 /*! \brief Process::isSuspend() - Tests if a process is suspended.
162                                  *
163                                  * \return                              This method returns 1 is the process is suspended.
164                                  *                                              Otherwise the method returns 0.
165                                  */
166                                 int isSuspended(void);
167                         
168                                 /*! \brief Process::getHost() - Retrieves the host of a process object.
169                                  *
170                                  * \return                              The method returns a reference to the
171                                  *                                              host of the process.
172                                  *
173                                  */
174                                 Host& getHost(void); 
175                         
176                                 /*! \brief Process::fromPID() - Retrieves a process from its PID.
177                                  *
178                                  * \param PID                   The PID of the process to retrieve.
179                                  *
180                                  * \return                              If successful the method returns a reference to
181                                  *                                              to process. Otherwise, the method throws one of
182                                  *                                              the exceptions described below:
183                                  *
184                                  * \exception                   [ProcessNotFoundException]      if the process is not found (no process with this PID).
185                                  *
186                                  *                                              [InvalidArgumentException]      if the parameter PID is less than 1.
187                                  *
188                                  *                                              [MsgException]                          if a native error occurs during the operation.
189                                  */
190                                 static Process& fromPID(int PID)
191                                 throw(ProcessNotFoundException, InvalidArgumentException, MsgException); 
192                         
193                                 /*! \brief Process::getPID() - Gets the PID of a process object.
194                                  *
195                                  * \return                              This method returns the PID of a process object.
196                                  */
197                                 int getPID(void);
198                                 
199                                 /*! \brief Process::getPPID() - Gets the parent PID of a process object.
200                                  *
201                                  * \return                              This method returns the parent PID of a process object.
202                                  */
203                                 int getPPID(void);
204                                 
205                                 /*! \brief Process::getName() - Gets the name of a process object.
206                                  *
207                                  * \return                              This method returns the name of a process object.
208                                  */
209                                 const char* getName(void) const;
210                         
211                                 /*! \brief Process::currentProcess() - Retrieves the current process.
212                                  *
213                                  * \return                              This method returns a reference to the current process. Otherwise
214                                  *                                              the method throws the excepction described below:
215                                  *
216                                  * \exception                   [MsgException]  if an internal exception occurs.
217                                  */
218                                 static Process& currentProcess(void)
219                                 throw (MsgException);
220                         
221                                 /*! \brief Process::currentProcessPID() - Retrieves the PID of the current process.
222                                  *
223                                  * \return                              This method returns the PID of the current process.
224                                  */
225                                 static int currentProcessPID(void);
226                                 
227                                 /*! \brief Process::currentProcessPPID() - Retrieves the parent PID of the current process.
228                                  *
229                                  * \return                              This method returns the parent PID of the current process.
230                                  */
231                                 static int currentProcessPPID(void);
232                         
233                                 /*! \brief Process::migrate() - Migrate a process object to an another host.
234                                  *
235                                  * \param rHost                 A reference to the host to migrate the process to.
236                                  *
237                                  * \return                              If successful the method migrate the process to the specified
238                                  *                                              host. Otherwise the method throws the exception described
239                                  *                                              below:
240                                  *
241                                  * \exception                   [MsgException]  if an internal exception occurs.
242                                  */
243                                 void migrate(const Host& rHost)
244                                 throw(MsgException);
245                         
246                                 /*! \brief Process::sleep() - Makes the current process sleep until time seconds have elapsed. 
247                                  *
248                                  * \param seconds                       The number of seconds to sleep.
249                                  *
250                                  * \execption                           If this method failed, it throws one of the exceptions described
251                                  *                                                      below: 
252                                  *
253                                  *                                                      [InvalidArgumentException]      if the parameter seconds is
254                                  *                                                      less or equals to zero.
255                                  *
256                                  *                                                      [MsgException] if an internal exception occurs.
257                                  */
258                                 static void sleep(double seconds)
259                                 throw(InvalidArgumentException, MsgException);
260                         
261                                 /*! \brief Process::putTask() - This method puts a task on a given channel of a given host.
262                                  *
263                                  * \exception                   If this method failed, it throws one of the exceptions described
264                                  *                                              below:
265                                  *
266                                  *                                              [InvalidArgumentException] if the channel number is negative.
267                                  *
268                                  *                                              [MsgException]                          if an internal exception occurs.
269                                  */
270                                 void putTask(const Host& rHost, int channel, Task* task)
271                                 throw(InvalidArgumentException, MsgException);
272                         
273                                 /*! \brief Process::putTask() - This method puts a task on a given channel of a given host (waiting at most given time).
274                                  *
275                                  * \exception                   If this method failed, it throws one of the exceptions described below:
276                                  *
277                                  *                                              [MsgException]                          if an internal error occurs.
278                                  *
279                                  *                                              [InvalidArgumentException]      if the value of the channel specified as
280                                  *                                                                                                      parameter is negative or if the timeout value
281                                  *                                                                                                      is less than zero and différent of -1.
282                                  *
283                                  * \remark                              Set the timeout with -1.0 to disable it.
284                                  */
285                                 void putTask(const Host& rHost, int channel, Task* task, double timeout) 
286                                 throw(InvalidArgumentException, MsgException);
287                         
288                                 /*! \brief Process::getTask() - Retrieves a task from a channel number (waiting at most given time).
289                                  *
290                                  * \param channel               The number of the channel where to get the task.
291                                  *
292                                  * \return                              If successful the method returns a reference to 
293                                  *                                              the getted task. Otherwise the method throws one
294                                  *                                              of the exceptions described below:
295                                  *
296                                  * \exception                   [InvalidArgumentException]      if the channel number is negative.
297                                  *
298                                  *                                              [MsgException]                          if an internal exception occurs.
299                                  */
300                                 Task* getTask(int channel) 
301                                 throw(InvalidArgumentException, MsgException);
302                         
303                                 /*! \brief Process::taskGet() - Retrieves a task from a channel number (waiting at most given time).
304                                  *
305                                  * \param channel               The number of the channel where to get the task.
306                                  * \param timeout               The timeout value.
307                                  *
308                                  * \return                              If successful the method returns a reference to 
309                                  *                                              the getted task. Otherwise the method throws one
310                                  *                                              of the exceptions described below:
311                                  *
312                                  * \exception                   [InvalidArgumentException]      if the channel number is negative
313                                  *                                                                                                      or if the timeout value is less than
314                                  *                                                                                                      zero and different of -1.0.
315                                  *                                              [MsgException]                          if an internal exception occurs.
316                                  */
317                                 Task* getTask(int channel, double timeout) 
318                                 throw(InvalidArgumentException, MsgException);
319                         
320                                 /*! \brief Process::taskGet() - Retrieves a task from a channel number and a host.
321                                  *
322                                  * \param channel               The number of the channel where to get the task.
323                                  * \param host                  The host of the channel to get the task.
324                                  *
325                                  * \return                              If successful the method returns a reference to 
326                                  *                                              the getted task. Otherwise the method throws one
327                                  *                                              of the exceptions described below.
328                                  *
329                                  * \exception                   [InvalidArgumentException]      if the channel number is negative.
330                                  *                                              [MsgException]                          if an internal exception occurs.
331                                  */
332                                 Task* getTask(int channel, const Host& rHost) 
333                                 throw(InvalidArgumentException, MsgException);
334                         
335                                 /*! \brief Process::taskGet() - Retrieves a task from a channel number and a host (waiting at most given time).
336                                  *
337                                  * \param channel               The number of the channel where to get the task.
338                                  * \param timeout               The timeout value.
339                                  * \param rHost                 The host owning the channel.
340                                  *
341                                  * \return                              If successful the method returns a reference to 
342                                  *                                              the getted task. Otherwise the method throws one
343                                  *                                              of the exceptions described below:
344                                  *
345                                  * \exception                   [InvalidArgumentException]      if the channel number is negative or
346                                  *                                                                                                      if the timeout value is negative and different
347                                  *                                                                                                      of -1.0.
348                                  *                                              [MsgException]                          if an internal exception occurs.
349                                  *
350                                  * \remark                              Set the timeout with -1.0 to disable it.
351                                  */
352                                 Task* getTask(int channel, double timeout, const Host& rHost)
353                                 throw(InvalidArgumentException, MsgException);
354                         
355                                 /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the specified alias
356                                  * (waiting at most given time).
357                                  *
358                                  * \param alias                         The alias of the mailbox where to send the task.
359                                  * \param rTask                         A reference to the task object to send.
360                                  * \param timeout                       The timeout value.
361                                  *
362                                  * \exception                           If this method failed, it throws one of the exceptions described below:
363                                  *
364                                  *                                                      [NullPointerException]          if the alias specified as parameter is NULL.
365                                  *      
366                                  *                                                      [InvalidArgumentException]      if the timeout value is negative and different than
367                                  *                                                                                                              -1.0
368                                  *                                                      [MsgException]                          if an internal exception occurs.
369                                  *
370                                  * \remark                                      Set the timeout with -1.0 to disable it.
371                                  */
372                                 void sendTask(const char* alias, Task* task, double timeout) 
373                                 throw(NullPointerException, InvalidArgumentException, MsgException);
374                         
375                                 /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the specified alias.
376                                  *
377                                  * \param alias                         The alias of the mailbox where to send the task.
378                                  * \param rTask                         A reference to the task object to send.
379                                  *
380                                  * \exception                           If this method failed, it throws one of the exceptions described below:
381                                  *
382                                  *                                                      [NullPointerException]          if the alias parameter is NULL.
383                                  *
384                                  *                                                      [MsgException]                          if an internal exception occurs.
385                                  *
386                                  */
387                                 void sendTask(const char* alias, Task* task) 
388                                 throw(NullPointerException, MsgException);
389                         
390                                 /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the default alias.
391                                  *
392                                  * \param rTask                         A reference to the task object to send.
393                                  *
394                                  * \exception                           If this method failed, it throws one of the exceptions described below:
395                                  *                                                      
396                                  *                                                      [BadAllocException]                     if there is not enough memory to build the default alias.
397                                  *
398                                  *                                                      [MsgException]                          if an internal exception occurs.
399                                  *
400                                  */
401                                 void sendTask(Task* task) 
402                                 throw(BadAllocException, MsgException);
403                         
404                                 /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the default alias
405                                  * (waiting at most given time).
406                                  *
407                                  * \param rTask                         A reference to the task object to send.
408                                  * \param timeout                       The timeout value.
409                                  *
410                                  * \exception                           If this method failed, it throws one of the exceptions described below:
411                                  *
412                                  *                                                      [BadAllocException]                     if there is not enough memory to build the default alias.
413                                  *
414                                  *                                                      [InvalidArgumentException]      if the timeout value is negative and different than -1.0.
415                                  *
416                                  *                                                      [MsgException]                          if an internal exception occurs.
417                                  *
418                                  * \remark                                      set the timeout value with -1.0 to disable it.
419                                  */
420                                 void sendTask(Task* task, double timeout) 
421                                 throw(BadAllocException, InvalidArgumentException, MsgException);
422                         
423                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias specified as
424                                  * parameter.
425                                  *
426                                  * \param alias                         The alias of the mailbox where to retrieve the task.
427                                  *
428                                  * \return                                      If succcessful, the method returns a task of the mailbox. Otherwise, the method
429                                  *                                                      throws one of the exceptions described below:
430                                  *
431                                  * \exception                           [NullPointerException]  if the parameter alias is NULL.
432                                  *
433                                  *                                                      [MsgException]                  if an internal exception occurs.
434                                  */
435                                 Task* receiveTask(const char* alias) 
436                                 throw(NullPointerException, MsgException);
437                         
438                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the default alias.
439                                  *
440                                  * \return                                      If succcessful, the method returns a task of the mailbox. Otherwise, the method
441                                  *                                                      throws one of the exceptions described below:
442                                  *
443                                  * \exception                           [BadAllocException]             if there is not enough memory to build the alias.                       
444                                  *                                                      [MsgException]                  if an internal exception occurs.
445                                  */
446                                 Task* receiveTask(void) 
447                                 throw(BadAllocException, MsgException);
448                         
449                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias specified as
450                                  * parameter(waiting at most given time).
451                                  *
452                                  * \param alias                         The alias of the mailbox where to retrieve the task.
453                                  * \param timeout                       The timeout value.
454                                  *
455                                  * \return                                      If succcessful, the method returns a task of the mailbox. Otherwise, the method
456                                  *                                                      throws one of the exceptions described below.
457                                  *
458                                  * \exception                           [InvalidArgumentException]      if the timeout value is negative or different of -1.0.
459                                  *
460                                  *                                                      [NullPointerException]          if the parameter alias is NULL.
461                                  *
462                                  *                                                      [MsgException]                          if an internal exception occurs.
463                                  */
464                                 Task* receiveTask(const char* alias, double timeout) 
465                                 throw(NullPointerException, InvalidArgumentException, MsgException);
466                         
467                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the default alias
468                                  * (waiting at most given time).
469                                  *
470                                  * \param timeout                       The timeout value.
471                                  *
472                                  * \return                                      If succcessful, the method returns a task of the mailbox. Otherwise, the method
473                                  *                                                      throws one of the exceptions described below:
474                                  *
475                                  * \exception                           [InvalidArgumentException]      if the timeout value is negative or different than -1.0.
476                                  *
477                                  *                                                      [BadAllocException]                     if there is not enough memory to build the alias.
478                                  *                      
479                                  *                                                      [MsgException]                          if an internal exception occurs.
480                                  */
481                                 Task* receiveTask(double timeout) 
482                                 throw(InvalidArgumentException, BadAllocException, MsgException);
483                         
484                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias specified as
485                                  * parameter located on a given host (waiting at most given time).
486                                  *
487                                  * \param alias                         The alias of the mailbox where to retrieve the task.
488                                  * \param timeout                       The timeout value.
489                                  * \param rHost                         A reference to the host object owning the mailbox.
490                                  *
491                                  * \return                                      If succcessful, the method returns a task of the mailbox. Otherwise, the method
492                                  *                                                      throws one of the exceptions described below:
493                                  *
494                                  * \exception                           [InvalidArgumentException]      if the timeout value is negative or different of -1.0.
495                                  *
496                                  *                                                      [NullPointerException]          if the parameter alias is NULL.
497                                  *
498                                  *                                                      [MsgException]                          if an internal exception occurs.
499                                  */
500                                 Task* receiveTask(const char* alias, double timeout, const Host& rHost) 
501                                 throw(NullPointerException, InvalidArgumentException, MsgException);
502                         
503                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by default alias
504                                  *  and located on a given host (waiting at most given time).
505                                  *
506                                  * \param timeout                       The timeout value.
507                                  * \param rHost                         A reference to the host object owning the mailbox.
508                                  *
509                                  * \return                                      If succcessful, the method returns a task of the mailbox. Otherwise, the method
510                                  *                                                      throws one of the exceptions described below:
511                                  *
512                                  * \exception                           [InvalidArgumentException]      if the timeout value is negative and different than -1.0.
513                                  *
514                                  *                                                      [BadAllocException]                     if there is not enough memory to build the default alias.
515                                  *
516                                  *                                                      [MsgException]                          if an internal exception occurs.
517                                  */
518                                 Task* receiveTask(double timeout, const Host& rHost) 
519                                 throw(BadAllocException, InvalidArgumentException, MsgException);
520                         
521                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias
522                                  *  specified as parameter and located on a given host.
523                                  *
524                                  * \param alias                 The alias using to identify the mailbox from which to get the task.
525                                  * \param rHost                 A reference to the host object owning the mailbox.
526                                  *
527                                  * \return                              If succcessful, the method returns a task of the mailbox. Otherwise, the method
528                                  *                                              throws one of the exceptions described below:
529                                  *
530                                  * \exception                   [NullPointerException]                  if the parameter alias is NULL.
531                                  *
532                                  *                                              [MsgException]                                  if an internal exception occurs.
533                                  */
534                                 Task* receiveTask(const char* alias, const Host& rHost) 
535                                 throw(NullPointerException, MsgException);
536                         
537                                 /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by default alias
538                                  *  and located on a given host.
539                                  *
540                                  * \param rHost                 A reference to the host object owning the mailbox.
541                                  *
542                                  * \return                              If succcessful, the method returns a task of the mailbox. Otherwise, the method
543                                  *                                              throws one of the exceptions described below:
544                                  *
545                                  * \exception                   [BadAllocException]                             if there is not enough memory to build the alias.
546                                  *
547                                  *                                              [MsgException]                                  if an internal exception occurs.
548                                  */
549                                 Task* receiveTask(const Host& rHost) 
550                                 throw(BadAllocException, MsgException);
551                         
552                                 
553                         private:
554                         
555                                 /* Process::create() - Creates a process on a given host.
556                                  *
557                                  * param rHost                  A reference to a host object where to create the process.
558                                  * param name                   The name of the process to create.
559                                  * param argc                   The number of argument to pass to the main function of the process.
560                                  * param argv                   The list of the arguments of the main function of the process.
561                                  *
562                                  * exception                    If this method failed, it throws one of the exceptions described below:
563                                  *
564                                  *                                              [HostNotFoundException] if the host specified as parameter doesn't exist.
565                                  */
566                                 void create(const Host& rHost, const char* name, int argc, char** argv) 
567                                 throw(InvalidArgumentException);
568                                 
569                                 /* Process::fromNativeProcess() - Retrieves the process wrapper associated with a native process.
570                                  *
571                                  * \param nativeProcess The native process to get the wrapper.
572                                  *
573                                  * \return                              The wrapper associated with the native process specified as parameter.
574                                  */
575                                 static Process* fromNativeProcess(m_process_t nativeProcess);
576                         
577                         
578                         public:
579                         
580                                 /* Process::run() - used to set the field code of the context of the process.
581                                  */ 
582                                 static int run(int argc, char** argv);
583                                 
584                                 /*! \brief Process::main() - This virtual pure function is the main function of the process.
585                                  * You must override this function for each new class of process that you create.
586                                  *
587                                  * \param argc                  The number of parameters of the main function.
588                                  * \param argv                  The list of the parameter of the main function.
589                                  *
590                                  * \return                              The exit code of the main function.
591                                  */
592                                 virtual int main(int argc, char** argv);
593
594                         // Operators.
595                                         
596                                 /*
597                                         // Override the operator new().
598                                         void* operator new(size_t size);
599                                         
600                                         // Override the operator delete().
601                                         void operator delete(void* p);
602                                  */
603                                 
604                         private:
605                                 
606                                 // Attributes.
607                                 
608                                 m_process_t nativeProcess;      // pointer to the native msg process.
609                         
610                 };
611         
612         } //namepace Msg
613
614 } // namespace SimGrid
615
616 #endif // !MSG_PROCESS_HPP
617