+void StateType::push_event(const std::string& value_name, TIData* extra)
+{
+ events_.push_back(new StateEvent(get_issuer(), this, PajeEventType::PushState, get_entity_value(value_name), extra));
+}
+
+void StateType::push_event(const std::string& value_name)
+{
+ events_.push_back(
+ new StateEvent(get_issuer(), this, PajeEventType::PushState, get_entity_value(value_name), nullptr));
+}
+
+void StateType::pop_event()
+{
+ pop_event(nullptr);
+}
+
+void StateType::pop_event(TIData* extra)
+{
+ events_.push_back(new StateEvent(get_issuer(), this, PajeEventType::PopState, nullptr, extra));
+}
+
+void VariableType::instr_event(double now, double delta, const char* resource, double value)
+{
+ /* To trace resource utilization, we use AddEvent and SubEvent only. This implies to add a SetEvent first to set the
+ * initial value of all variables for subsequent adds/subs. If we don't do so, the first AddEvent would be added to a
+ * non-determined value, hence causing analysis problems.
+ */
+
+ // to check if variables were previously set to 0, otherwise paje won't simulate them
+ static std::set<std::string, std::less<>> platform_variables;
+
+ // create a key considering the resource and variable
+ std::string key = std::string(resource) + get_name();
+
+ // check if key exists: if it doesn't, set the variable to zero and mark this in the global map.
+ if (platform_variables.find(key) == platform_variables.end()) {
+ set_event(now, 0);
+ platform_variables.insert(key);
+ }
+
+ add_event(now, value);
+ sub_event(now + delta, value);
+}
+
+void VariableType::set_event(double timestamp, double value)
+{
+ events_.push_back(new VariableEvent(timestamp, get_issuer(), this, PajeEventType::SetVariable, value));
+}
+
+void VariableType::add_event(double timestamp, double value)
+{
+ events_.push_back(new VariableEvent(timestamp, get_issuer(), this, PajeEventType::AddVariable, value));
+}
+
+void VariableType::sub_event(double timestamp, double value)
+{
+ events_.push_back(new VariableEvent(timestamp, get_issuer(), this, PajeEventType::SubVariable, value));
+}
+
+void LinkType::start_event(Container* startContainer, const std::string& value, const std::string& key, size_t size)
+{
+ new LinkEvent(get_issuer(), this, PajeEventType::StartLink, startContainer, value, key, size);
+}
+
+void LinkType::end_event(Container* endContainer, const std::string& value, const std::string& key)
+{
+ new LinkEvent(get_issuer(), this, PajeEventType::EndLink, endContainer, value, key);
+}
+
+Type* Type::by_name(const std::string& name)