Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to silence CI on maverick
[simgrid.git] / src / instr / instr_paje_containers.hpp
1 /* Copyright (c) 2010-2017. 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 INSTR_PAJE_CONTAINERS_HPP
7 #define INSTR_PAJE_CONTAINERS_HPP
8
9 #include "src/instr/instr_private.hpp"
10 #include <string>
11
12 namespace simgrid {
13 namespace instr {
14 class Type;
15
16 class Container {
17   long long int id_;
18   std::string name_; /* Unique name of this container */
19 public:
20   Container(std::string name, std::string type_name, Container* father);
21   virtual ~Container();
22
23   Type* type_; /* Type of this container */
24   Container* father_;
25   std::map<std::string, Container*> children_;
26   sg_netpoint_t netpoint_ = nullptr;
27
28   static Container* byNameOrNull(std::string name);
29   static Container* byName(std::string name);
30   std::string getName() { return name_; }
31   const char* getCname() { return name_.c_str(); }
32   long long int getId() { return id_; }
33   void removeFromParent();
34   void logCreation();
35   void logDestruction();
36
37   static Container* getRootContainer();
38 };
39
40 class NetZoneContainer : public Container {
41 public:
42   NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father);
43 };
44
45 class RouterContainer : public Container {
46 public:
47   RouterContainer(std::string name, Container* father);
48 };
49
50 class HostContainer : public Container {
51 public:
52   HostContainer(simgrid::s4u::Host& host, NetZoneContainer* father);
53 };
54 }
55 }
56 #endif