1 #ifndef _XBT_CONTEXT_FACTORY_H
\r
2 #define _XBT_CONTEXT_FACTORY_H
\r
4 #include "portable.h"
\r
5 #include "xbt/function_types.h"
\r
6 #include "xbt_context_private.h"
\r
10 /* forward declaration */
\r
11 struct s_xbt_context_factory;
\r
13 /* this function describes the interface that all context factory must implement */
\r
14 typedef xbt_context_t (*xbt_pfn_context_factory_create_context_t)(const char*, xbt_main_func_t, void_f_pvoid_t, void*, void_f_pvoid_t, void*, int, char**);
\r
15 typedef int (*xbt_pfn_context_factory_create_maestro_context_t)(xbt_context_t*);
\r
17 /* this function finalize the specified context factory */
\r
18 typedef int (*xbt_pfn_context_factory_finalize_t)(struct s_xbt_context_factory**);
\r
20 /* this interface is used by the xbt context module to create the appropriate concept */
\r
21 typedef struct s_xbt_context_factory
\r
23 xbt_pfn_context_factory_create_maestro_context_t create_maestro_context; /* create the context of the maestro */
\r
24 xbt_pfn_context_factory_create_context_t create_context; /* create a new context */
\r
25 xbt_pfn_context_factory_finalize_t finalize; /* finalize the context factory */
\r
26 const char* name; /* the name of the context factory */
\r
28 }s_xbt_context_factory_t;
\r
31 * This function select a context factory associated with the name specified by
\r
32 * the parameter name.
\r
33 * If successful the function returns 0. Otherwise the function returns the error
\r
37 xbt_context_select_factory(const char* name);
\r
40 * This function initialize a context factory from the name specified by the parameter
\r
42 * If successful the factory specified by the parameter factory is initialized and the
\r
43 * function returns 0. Otherwise the function returns the error code.
\r
46 xbt_context_init_factory_by_name(xbt_context_factory_t* factory, const char* name);
\r
51 #endif /* !_XBT_CONTEXT_FACTORY_H */
\r