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/job.hpp> 00007 #include <saga/saga/adaptors/task.hpp> 00008 #include <saga/impl/job.hpp> 00009 #include <saga/impl/packages/job/job_runtime.hpp> 00010 00012 namespace saga { namespace job 00013 { 00014 ostream::ostream(saga::impl::ostream_interface *impl) 00015 : std::ios(0), base_type(impl->get_streambuf()), impl_(impl) 00016 { 00017 } 00018 00019 ostream::ostream(ostream const& rhs) 00020 : std::ios(0), base_type(rhs.rdbuf()), impl_(rhs.impl_) 00021 { 00022 this->copyfmt(rhs); 00023 this->clear(rhs.rdstate()); 00024 } 00025 00026 ostream::ostream() 00027 : std::ios(0), base_type(0) 00028 { 00029 this->clear(std::ios::eofbit); 00030 } 00031 00032 ostream::~ostream() 00033 { 00034 //if (this->good()) 00035 // this->flush(); // make sure the stream gets flushed in the end 00036 } 00037 00038 ostream& ostream::operator=(ostream const& rhs) 00039 { 00040 if (this != &rhs) { 00041 this->copyfmt(rhs); 00042 this->clear(rhs.rdstate()); 00043 this->std::basic_ios<char>::rdbuf(rhs.rdbuf()); 00044 impl_ = rhs.impl_; 00045 } 00046 return *this; 00047 } 00048 00050 namespace detail 00051 { 00052 handle_type get_handle(saga::job::ostream const& ostrm, bool detach) 00053 { 00054 return saga::impl::job_runtime::get_handle(ostrm, detach); 00055 } 00056 } 00057 00059 }} // namespace saga 00060