return type_id++;
}
-container_t PJ_container_get_root()
-{
- return rootContainer;
-}
+namespace simgrid {
+namespace instr {
-void PJ_container_set_root (container_t root)
+container_t Container::getRootContainer()
{
- rootContainer = root;
+ return rootContainer;
}
-namespace simgrid {
-namespace instr {
-
NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father)
: Container::Container(name, "", father)
{
father_->children_.insert({getName(), this});
logCreation();
} else {
- type_ = Type::createRootType();
- PJ_container_set_root(this);
+ type_ = new ContainerType("0");
+ rootContainer = this;
}
}
TRACE_paje_dump_buffer(true);
// trace my destruction
- if (not TRACE_disable_destroy() && this != PJ_container_get_root()) {
+ if (not TRACE_disable_destroy() && this != Container::getRootContainer()) {
// do not trace the container destruction if user requests or if the container is root
logDestruction();
}
double timestamp = SIMIX_get_clock();
std::stringstream stream;
- XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_CreateContainer, timestamp);
+ XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_CreateContainer, timestamp);
if (instr_fmt_type == instr_fmt_paje) {
stream << std::fixed << std::setprecision(TRACE_precision());
xbt_free(folder_name);
xbt_free(filename);
}
-
tracing_files.insert({this, ti_unique_file});
} else {
THROW_IMPOSSIBLE;
std::stringstream stream;
double timestamp = SIMIX_get_clock();
- XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_DestroyContainer, timestamp);
+ XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_DestroyContainer, timestamp);
if (instr_fmt_type == instr_fmt_paje) {
stream << std::fixed << std::setprecision(TRACE_precision());
THROW_IMPOSSIBLE;
}
}
+
+StateType* Container::getState(std::string name)
+{
+ StateType* ret = dynamic_cast<StateType*>(type_->byName(name));
+ ret->setCallingContainer(this);
+ return ret;
+}
+
+LinkType* Container::getLink(std::string name)
+{
+ return dynamic_cast<LinkType*>(type_->byName(name));
+}
+
+VariableType* Container::getVariable(std::string name)
+{
+ VariableType* ret = dynamic_cast<VariableType*>(type_->byName(name));
+ ret->setCallingContainer(this);
+ return ret;
+}
}
}