Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make simix headers public so that we can write external bindings
[simgrid.git] / include / simix / datatypes.h
1 /* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SIMIX_DATATYPES_H
8 #define _SIMIX_DATATYPES_H
9 #include "xbt/misc.h"
10 #include "xbt/swag.h"
11 #include "xbt/fifo.h"
12 #include "xbt/dict.h"
13
14 SG_BEGIN_DECL()
15
16 /* ******************************** Host ************************************ */
17 /** @defgroup m_datatypes_management_details Details on SIMIX datatypes */
18 /** @brief Host datatype  
19     @ingroup m_datatypes_management
20
21     A <em>location</em> (or <em>host</em>) is any possible place where
22     a process may run. Thus it is represented as a <em>physical
23     resource with computing capabilities</em>, some <em>mailboxes</em>
24     to enable running process to communicate with remote ones, and
25     some <em>private data</em> that can be only accessed by local
26     process.
27
28     \see m_host_management
29   @{ */
30 typedef struct s_smx_host *smx_host_t;
31 typedef enum {
32   SIMIX_WAITING,
33   SIMIX_READY,
34   SIMIX_RUNNING,
35   SIMIX_DONE,
36   SIMIX_CANCELED,
37   SIMIX_FAILED,
38   SIMIX_SRC_HOST_FAILURE,
39   SIMIX_DST_HOST_FAILURE,
40   SIMIX_SRC_TIMEOUT,
41   SIMIX_DST_TIMEOUT,
42   SIMIX_LINK_FAILURE,
43 } e_smx_state_t;
44 /** @} */
45
46
47 typedef struct s_smx_timer* smx_timer_t;
48
49
50 /* ******************************** Synchro ************************************ */
51 typedef struct s_smx_mutex *smx_mutex_t;
52 typedef struct s_smx_cond *smx_cond_t;
53 typedef struct s_smx_sem *smx_sem_t;
54
55 /********************************** Action *************************************/
56 typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized action handlers */
57
58
59
60 /* ****************************** Process *********************************** */
61 /** @brief Agent datatype  
62     @ingroup m_datatypes_management 
63
64     An agent may be defined as a <em>code</em>, with some <em>private
65     data</em>, executing in a <em>location</em>.
66     \see m_process_management
67   @{ */
68 typedef struct s_smx_process *smx_process_t;
69 /** @} */
70
71
72 /* User create and kill process, the function must accept the folling parameters:
73  * const char *name: a name for the object. It is for user-level information and can be NULL
74  * xbt_main_func_t code: is a function describing the behavior of the agent
75  * void *data: data a pointer to any data one may want to attach to the new object.
76  * smx_host_t host: the location where the new agent is executed
77  * int argc, char **argv: parameters passed to code
78  *
79  * */
80 typedef void *(*smx_creation_func_t) ( /*name */ const char *,
81                                       /*code */ xbt_main_func_t,
82                                       /*userdata */ void *,
83                                       /*hostname */ char *,
84                                       /* argc */ int,
85                                       /* argv */ char **,
86                                       /* props */ xbt_dict_t);
87
88
89 /******************************* Networking ***********************************/
90 typedef struct s_smx_rvpoint *smx_rdv_t;
91
92
93 SG_END_DECL()
94 #endif