Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
b81a57f5919b7a5a39c7337e2c6a7a2cddb119cd
[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 #include <simgrid/s4u/forward.hpp>
12
13 namespace simgrid {
14 namespace s4u {
15 /** @brief Simulation engine
16  *
17  * This class is an interface to the simulation engine.
18  */
19 XBT_PUBLIC_CLASS Engine {
20 public:
21   /** Constructor, taking the command line parameters of your main function */
22   Engine(int *argc, char **argv);
23
24   /** @brief Load a platform file describing the environment
25    *
26    * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
27    * Some examples can be found in the directory examples/platforms.
28    */
29   void loadPlatform(const char *platf);
30
31   /** Registers the main function of an actor that will be launched from the deployment file */
32   void registerFunction(const char*name, int (*code)(int,char**));
33
34   /** Registers a function as the default main function of actors
35    *
36    * It will be used as fallback when the function requested from the deployment file was not registered.
37    * It is used for trace-based simulations (see examples/msg/actions).
38    */
39   void registerDefault(int (*code)(int,char**));
40
41   /** @brief Load a deployment file and launch the actors that it contains */
42   void loadDeployment(const char *deploy);
43
44   /** @brief Run the simulation */
45   void run();
46
47   /** @brief Retrieve the simulation time */
48   static double getClock();
49   
50 };
51 }} // namespace simgrid::sgo
52
53 #endif /* SIMGRID_S4U_ENGINE_HPP */