Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
99494dc76cfdf61279db04862fb46443977295dd
[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/string.hpp>
17 #include <xbt/Extendable.hpp>
18
19
20 namespace simgrid {
21
22 XBT_PUBLIC_CLASS Host :
23 public simgrid::xbt::Extendable<Host> {
24
25 public:
26         double getSpeed();
27         int getCoreAmount();
28
29         /* FIXME: these should be protected, but it leads to many errors */
30         surf::Cpu     *p_cpu = nullptr;
31         surf::NetCard *p_netcard = nullptr;
32 private:
33   simgrid::xbt::string name_ = "noname";
34 public:
35   Host(std::string const& name);
36   ~Host();
37   simgrid::xbt::string const& getName() const { return name_; }
38   static Host* by_name_or_null(const char* name);
39   static Host* by_name_or_create(const char* name);
40 };
41
42 }
43
44 #endif