-struct HostAttribute {
- /* Earliest time at which a host is ready to execute a task */
- double available_at = 0.0;
- sg4::Exec* last_scheduled_task = nullptr;
-};
-
-static double sg_host_get_available_at(const sg4::Host* host)
-{
- return host->get_data<HostAttribute>()->available_at;
-}
-
-static void sg_host_set_available_at(const sg4::Host* host, double time)
-{
- host->get_data<HostAttribute>()->available_at = time;
-}
-
-static sg4::Exec* sg_host_get_last_scheduled_task(const sg4::Host* host)
-{
- return host->get_data<HostAttribute>()->last_scheduled_task;
-}
-
-static void sg_host_set_last_scheduled_task(const sg4::Host* host, sg4::ExecPtr task)
-{
- host->get_data<HostAttribute>()->last_scheduled_task = task.get();
-}
-
-static bool dependency_exists(const sg4::Exec* src, sg4::Exec* dst)
-{
- const auto& dependencies = src->get_dependencies();
- const auto& successors = src->get_successors();
- return (std::find(successors.begin(), successors.end(), dst) != successors.end() ||
- dependencies.find(dst) != dependencies.end());
-}
-