SAGA Adaptor CPI v.1.0
|
00001 // Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) 00002 // Copyright (c) 2007 Ole Weidner (oweidner@cct.lsu.edu) 00003 // 00004 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00006 00007 #ifndef SAGA_TASK_BASE_HPP 00008 #define SAGA_TASK_BASE_HPP 00009 00010 #include <saga/saga/util.hpp> 00011 #include <boost/mpl/has_xxx.hpp> 00012 00014 namespace saga 00015 { 00016 namespace attributes 00017 { 00018 // textual representation of task states, required as metric values 00019 char const* const task_state_unknown = "Unknown"; 00020 char const* const task_state_new = "New"; 00021 char const* const task_state_running = "Running"; 00022 char const* const task_state_done = "Done"; 00023 char const* const task_state_canceled = "Canceled"; 00024 char const* const task_state_failed = "Failed"; 00025 } 00026 00031 struct task_base 00032 { 00050 enum state 00051 { 00052 Unknown = -1, 00053 New = 1, 00054 Running = 2, 00055 Done = 3, 00056 Canceled = 4, 00057 Failed = 5 00058 }; 00059 00061 00062 // tagging definitions 00063 struct Sync { struct sync_tag; }; 00064 struct Async { struct sync_tag; }; 00065 struct Task { struct sync_tag; }; 00067 }; 00068 00070 namespace detail 00071 { 00072 BOOST_MPL_HAS_XXX_TRAIT_DEF(sync_tag) 00073 } 00074 00075 namespace adaptors 00076 { 00077 task_base::state SAGA_EXPORT task_state_value_to_enum(std::string const& val); 00078 std::string SAGA_EXPORT task_state_enum_to_value(int s); 00079 } 00082 } // namespace saga 00083 00084 #endif // SAGA_TASK_BASE_HPP 00085