#include "src/instr/instr_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
#include "src/instr/instr_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
-simgrid::instr::Value::Value(std::string name, std::string color, simgrid::instr::Type* father)
- : name_(name), color_(color), father_(father)
+namespace simgrid {
+namespace instr {
+
+Value::Value(std::string name, std::string color, Type* father) : name_(name), color_(color), father_(father)
{
if (name.empty() || father == nullptr) {
THROWF(tracing_error, 0, "can't create a value with no name (or a nullptr father)");
{
if (name.empty() || father == nullptr) {
THROWF(tracing_error, 0, "can't create a value with no name (or a nullptr father)");
+ XBT_DEBUG("free value %s, child of %s", getCname(), father_->getCname());
+}
+
+Value* Value::byNameOrCreate(std::string name, std::string color, Type* father)
+{
+ Value* ret = nullptr;
{
if (name.empty() || father == nullptr) {
THROWF(tracing_error, 0, "can't get a value with no name (or a nullptr father)");
}
{
if (name.empty() || father == nullptr) {
THROWF(tracing_error, 0, "can't get a value with no name (or a nullptr father)");
}
THROWF(tracing_error, 0, "variables can't have different values (%s)", father->getCname());
auto ret = father->values_.find(name);
if (ret == father->values_.end()) {
THROWF(tracing_error, 0, "variables can't have different values (%s)", father->getCname());
auto ret = father->values_.find(name);
if (ret == father->values_.end()) {