SAGA Adaptor CPI v.1.0
|
00001 // Copyright (c) 2005-2009 Hartmut Kaiser 00002 // 00003 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00005 00006 #include <saga/saga/task.hpp> 00007 #include <saga/saga/session.hpp> 00008 #include <saga/saga/packages/stream/adaptors/stream.hpp> 00009 00010 #include <saga/impl/stream.hpp> 00011 00013 namespace saga { namespace adaptors { 00014 00015 stream::stream (saga::adaptors::v1_0::stream_cpi_instance_data* data, 00016 saga::session const& s) 00017 : saga::stream::stream(new saga::impl::stream(data, s)) 00018 { 00019 } 00020 00021 stream::stream (saga::adaptors::v1_0::stream_cpi_instance_data* data) 00022 : saga::stream::stream( 00023 new saga::impl::stream(data, saga::detail::get_the_session())) 00024 { 00025 } 00026 00027 stream::~stream() 00028 { 00029 } 00030 00031 std::string get_state_name(saga::stream::state s) 00032 { 00033 switch (s) { 00034 case saga::stream::New: return "New"; 00035 case saga::stream::Open: return "Open"; 00036 case saga::stream::Closed: return "Closed"; 00037 case saga::stream::Dropped: return "Dropped"; 00038 case saga::stream::Error: return "Error"; 00039 case saga::stream::Unknown: 00040 default: 00041 break; 00042 } 00043 return "<Unknown>"; 00044 } 00045 00047 }} // namespace saga::adaptors 00048