Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[S4U] declare the classes as public for Windows
[simgrid.git] / include / simgrid / s4u / engine.hpp
1 /* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_S4U_ENGINE_HPP
7 #define SIMGRID_S4U_ENGINE_HPP
8
9 #include <xbt/base.h>
10
11 namespace simgrid {
12 namespace s4u {
13 /** @brief Simulation engine
14  *
15  * This class is an interface to the simulation engine.
16  */
17 XBT_PUBLIC_CLASS Engine {
18 public:
19         /** Constructor, taking the command line parameters of your main function */
20         Engine(int *argc, char **argv);
21
22         /** @brief Load a platform file describing the environment
23          *
24          * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
25          * Some examples can be found in the directory examples/platforms.
26          */
27         void loadPlatform(const char *platf);
28
29         /** Registers the main function of an actor that will be launched from the deployment file */
30         void register_function(const char*name, int (*code)(int,char**));
31
32         /** Registers a function as the default main function of actors
33          *
34          * It will be used as fallback when the function requested from the deployment file was not registered.
35          * It is used for trace-based simulations (see examples/msg/actions).
36          */
37         void register_default(int (*code)(int,char**));
38
39         /** @brief Load a deployment file and launch the actors that it contains */
40         void loadDeployment(const char *deploy);
41
42         /** @brief Run the simulation */
43         void run();
44
45         /** @brief Retrieve the simulation time */
46         static double getClock();
47         
48 };
49 }} // namespace simgrid::sgo
50
51 #endif /* SIMGRID_S4U_ENGINE_HPP */