+ template <class F> void register_actor(const std::string& name, F code)
+ {
+ kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
+ return kernel::actor::ActorCode([code, args = std::move(args)]() mutable { code(std::move(args)); });
+ };
+ register_function(name, code_factory);
+ }
+
+ void load_deployment(const std::string& deploy) const;
+
+protected:
+#ifndef DOXYGEN
+ friend Host;
+ friend Link;
+ friend Disk;
+ friend kernel::routing::NetPoint;
+ friend kernel::routing::NetZoneImpl;
+ friend kernel::resource::LinkImpl;
+ void host_register(const std::string& name, Host* host);
+ void host_unregister(const std::string& name);
+ void link_register(const std::string& name, const Link* link);
+ void link_unregister(const std::string& name);
+ void netpoint_register(simgrid::kernel::routing::NetPoint* card);
+ void netpoint_unregister(simgrid::kernel::routing::NetPoint* card);
+#endif /*DOXYGEN*/
+
+public:
+ /** Returns the amount of hosts existing in the platform. */
+ size_t get_host_count() const;
+ /** Returns a vector of all hosts found in the platform.
+ *
+ * The order is generally different from the creation/declaration order in the XML platform because we use a hash
+ * table internally.
+ */
+ std::vector<Host*> get_all_hosts() const;
+ std::vector<Host*> get_filtered_hosts(const std::function<bool(Host*)>& filter) const;
+ Host* host_by_name(const std::string& name) const;
+ Host* host_by_name_or_null(const std::string& name) const;
+
+ size_t get_link_count() const;
+ std::vector<Link*> get_all_links() const;
+ std::vector<Link*> get_filtered_links(const std::function<bool(Link*)>& filter) const;
+ Link* link_by_name(const std::string& name) const;
+ Link* link_by_name_or_null(const std::string& name) const;
+
+ size_t get_actor_count() const;
+ std::vector<ActorPtr> get_all_actors() const;
+ std::vector<ActorPtr> get_filtered_actors(const std::function<bool(ActorPtr)>& filter) const;
+
+ std::vector<kernel::routing::NetPoint*> get_all_netpoints() const;
+ kernel::routing::NetPoint* netpoint_by_name_or_null(const std::string& name) const;
+
+ NetZone* get_netzone_root() const;
+ void set_netzone_root(const NetZone* netzone);
+
+ NetZone* netzone_by_name_or_null(const std::string& name) const;