00001 #ifndef __TSORT_H__
00002 #define __TSORT_H__
00003
00004 #include <list>
00005 #include <set>
00006 #include <utility>
00007 #include <iostream>
00008 #include "stm_export.h"
00009
00010 namespace control {
00011
00012
00013
00014
00015 bool STM_EXPORT topological_sort(const std::set<std::pair<int, int> > &edges,
00016 std::list<int> &order);
00017
00018
00019
00020 void STM_EXPORT calculate_schedule(const std::set<std::pair<int, int> > &edges,
00021 const std::set<int> &completed,
00022 std::set<int> &can_run);
00023
00024
00025
00026 void STM_EXPORT find_descendants(const std::set<std::pair<int, int> > &edges,
00027 const std::set<int> &root,
00028 std::set<int> &out);
00029
00030 }
00031
00032 #endif