Logo AND Algorithmique Numérique Distribuée

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