1 /* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef INSTR_PAJE_CONTAINERS_HPP
7 #define INSTR_PAJE_CONTAINERS_HPP
9 #include "src/instr/instr_private.hpp"
21 std::string name_; /* Unique name of this container */
23 Container(const std::string& name, const std::string& type_name, Container* father);
24 Container(const Container&) = delete;
25 Container& operator=(const Container&) = delete;
28 Type* type_; /* Type of this container */
30 std::map<std::string, Container*> children_;
31 kernel::routing::NetPoint* netpoint_ = nullptr;
33 static Container* by_name_or_null(const std::string& name);
34 static Container* by_name(const std::string& name);
35 const std::string& get_name() const { return name_; }
36 const char* get_cname() { return name_.c_str(); }
37 long long int get_id() { return id_; }
38 void remove_from_parent();
40 void log_destruction();
42 StateType* get_state(const std::string& name);
43 LinkType* get_link(const std::string& name);
44 VariableType* get_variable(const std::string& name);
45 void create_child(const std::string& name, const std::string& type_name);
46 static Container* get_root();
49 class NetZoneContainer : public Container {
51 NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* father);
54 class RouterContainer : public Container {
56 RouterContainer(const std::string& name, Container* father);
59 class HostContainer : public Container {
61 HostContainer(simgrid::s4u::Host const& host, NetZoneContainer* father);