A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update copyright lines.
[simgrid.git]
/
src
/
instr
/
instr_paje_containers.hpp
diff --git
a/src/instr/instr_paje_containers.hpp
b/src/instr/instr_paje_containers.hpp
index
0e49398
..
3ab8fe8
100644
(file)
--- a/
src/instr/instr_paje_containers.hpp
+++ b/
src/instr/instr_paje_containers.hpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010-20
19
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-20
21
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-17,49
+17,56
@@
class StateType;
class VariableType;
class Container {
class VariableType;
class Container {
+ static Container* root_container_;
+ static std::map<std::string, Container*, std::less<>> all_containers_;
+
long long int id_;
std::string name_; /* Unique name of this container */
long long int id_;
std::string name_; /* Unique name of this container */
+
+protected:
+ static void set_root(Container* root) { root_container_ = root; }
+
public:
public:
- Container(std::string name, const std::string& type_name, Container* father);
+ static xbt::signal<void(Container const&)> on_creation;
+ static xbt::signal<void(Container const&)> on_destruction;
+
+ explicit Container(const std::string& name, const std::string& type_name, Container* father);
Container(const Container&) = delete;
Container& operator=(const Container&) = delete;
virtual ~Container();
Type* type_; /* Type of this container */
Container* father_;
Container(const Container&) = delete;
Container& operator=(const Container&) = delete;
virtual ~Container();
Type* type_; /* Type of this container */
Container* father_;
- std::map<std::string, Container*> children_;
- kernel::routing::NetPoint* netpoint_ = nullptr;
+ std::map<std::string, Container*, std::less<>> children_;
static Container* by_name_or_null(const std::string& name);
static Container* by_name(const std::string& name);
const std::string& get_name() const { return name_; }
static Container* by_name_or_null(const std::string& name);
static Container* by_name(const std::string& name);
const std::string& get_name() const { return name_; }
- const char* get_cname() { return name_.c_str(); }
- long long int get_id() { return id_; }
+ const char* get_cname()
const
{ return name_.c_str(); }
+ long long int get_id()
const
{ return id_; }
void remove_from_parent();
void remove_from_parent();
- void log_creation();
- void log_destruction();
StateType* get_state(const std::string& name);
LinkType* get_link(const std::string& name);
VariableType* get_variable(const std::string& name);
StateType* get_state(const std::string& name);
LinkType* get_link(const std::string& name);
VariableType* get_variable(const std::string& name);
- void create_child(
std::string
name, const std::string& type_name);
- static Container* get_root()
;
+ void create_child(
const std::string&
name, const std::string& type_name);
+ static Container* get_root()
{ return root_container_; }
};
class NetZoneContainer : public Container {
public:
};
class NetZoneContainer : public Container {
public:
- NetZoneContainer(
std::string
name, unsigned int level, NetZoneContainer* father);
+ NetZoneContainer(
const std::string&
name, unsigned int level, NetZoneContainer* father);
};
class RouterContainer : public Container {
public:
};
class RouterContainer : public Container {
public:
- RouterContainer(
std::string
name, Container* father);
+ RouterContainer(
const std::string&
name, Container* father);
};
class HostContainer : public Container {
public:
};
class HostContainer : public Container {
public:
- HostContainer(s
imgrid::s4u::Ho
st& host, NetZoneContainer* father);
+ HostContainer(s
4u::Host con
st& host, NetZoneContainer* father);
};
};
-}
-}
+}
// namespace instr
+}
// namespace simgrid
#endif
#endif