Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[S4U] Engine: Add Engine::get_filtered_links
[simgrid.git] / include / simgrid / s4u / Engine.hpp
index 43c4920..8d9477c 100644 (file)
@@ -27,7 +27,10 @@ namespace s4u {
 class XBT_PUBLIC Engine {
 public:
   /** Constructor, taking the command line parameters of your main function */
-  Engine(int* argc, char** argv);
+  explicit Engine(int* argc, char** argv);
+  /** Currently, only one instance is allowed to exist. This is why you can't copy or move it */
+  Engine(const Engine&) = delete;
+  Engine(Engine&&)      = delete;
 
   ~Engine();
   /** Finalize the default engine and all its dependencies */
@@ -95,11 +98,13 @@ protected:
 public:
   size_t get_host_count();
   std::vector<Host*> get_all_hosts();
+  std::vector<Host*> get_filtered_hosts(std::function<bool(Host*)> filter);
   simgrid::s4u::Host* host_by_name(std::string name);
   simgrid::s4u::Host* host_by_name_or_null(std::string name);
 
   size_t get_link_count();
   std::vector<Link*> get_all_links();
+  std::vector<Link*> get_filtered_links(std::function<bool(Link*)> filter);
 
   size_t get_storage_count();
   std::vector<Storage*> get_all_storages();
@@ -110,6 +115,7 @@ public:
   simgrid::kernel::routing::NetPoint* netpoint_by_name_or_null(std::string name);
 
   simgrid::s4u::NetZone* get_netzone_root();
+  void set_netzone_root(s4u::NetZone* netzone);
 
   simgrid::s4u::NetZone* netzone_by_name_or_null(const char* name);
 
@@ -133,9 +139,8 @@ public:
    */
   void set_config(std::string str);
 
-  simgrid::kernel::EngineImpl* pimpl;
-
 private:
+  simgrid::kernel::EngineImpl* pimpl;
   static s4u::Engine* instance_;
 
   //////////////// Deprecated functions