Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove completely the energy concern from the core
[simgrid.git] / include / simgrid / Host.hpp
1 /* Copyright (c) 2015. 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 SIMGRID_HOST_HPP
8 #define SIMGRID_HOST_HPP
9
10 #include <cstddef>
11 #include <memory>
12 #include <string>
13 #include <vector>
14
15 #include <xbt/base.h>
16 #include <xbt/dict.h>
17 #include <xbt/swag.h>
18 #include <xbt/string.hpp>
19 #include <xbt/Extendable.hpp>
20
21 #include <simgrid/datatypes.h>
22
23 namespace simgrid {
24
25 XBT_PUBLIC_CLASS Host :
26 public simgrid::xbt::Extendable<Host> {
27
28 public:
29         double getSpeed();
30         int getCoreAmount();
31
32         /* FIXME: these should be protected, but it leads to many errors */
33         surf::Cpu     *pimpl_cpu = nullptr;
34         surf::NetCard *pimpl_netcard = nullptr;
35 private:
36   simgrid::xbt::string name_ = "noname";
37 public:
38   Host(std::string const& name);
39   ~Host();
40   simgrid::xbt::string const& getName() const { return name_; }
41   void turnOn();
42   void turnOff();
43   bool isOn();
44   bool isOff();
45   xbt_dict_t getProperties();
46   xbt_swag_t getProcessList();
47   double getCurrentPowerPeak();
48   double getPowerPeakAt(int pstate_index);
49   void setPState(int pstate_index);
50   int getPState();
51   void getParams(vm_params_t params);
52   void setParams(vm_params_t params);
53   xbt_dict_t getMountedStorageList();
54   xbt_dynar_t getAttachedStorageList();
55
56   static Host* by_name_or_null(const char* name);
57   static Host* by_name_or_create(const char* name);
58 };
59
60 }
61
62 #endif