-/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2022. 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. */
#include <string>
#include <vector>
-namespace simgrid {
-namespace instr {
+namespace simgrid::instr {
class ContainerType;
class EventType;
std::map<std::string, std::unique_ptr<Type>, std::less<>> children_;
Container* issuer_ = nullptr;
+ static xbt::signal<void(Type const&, PajeEventType event_type)> on_creation;
+
protected:
Container* get_issuer() const { return issuer_; }
public:
- static xbt::signal<void(Type const&, PajeEventType event_type)> on_creation;
+ static void on_creation_cb(const std::function<void(Type const&, PajeEventType event_type)>& cb)
+ {
+ on_creation.connect(cb);
+ }
Type(PajeEventType event_type, const std::string& name, const std::string& alias, const std::string& color,
Type* parent);
};
class LinkType : public ValueType {
-public:
static xbt::signal<void(LinkType const&, Type const&, Type const&)> on_creation;
+
+public:
+ static void on_creation_cb(const std::function<void(LinkType const&, Type const&, Type const&)>& cb)
+ {
+ on_creation.connect(cb);
+ }
LinkType(const std::string& name, const Type* source, const Type* dest, const std::string& alias, Type* parent)
: ValueType(PajeEventType::DefineLinkType, name, alias, parent)
{
void pop_event();
void pop_event(TIData* extra);
};
-} // namespace instr
-} // namespace simgrid
+} // namespace simgrid::instr
#endif