SAGA Adaptor CPI v.1.0
|
00001 // Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) 00002 // Copyright (c) 2005-2009 Hartmut Kaiser 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 // this is needed in every file including detail/permissions_impl.hpp and not 00008 // belonging to the engine 00009 #define SAGA_NO_IMPORT_PERMISSIONS 00010 00011 // include rpc API and implementation 00012 #include <saga/saga/rpc.hpp> 00013 #include <saga/impl/rpc.hpp> 00014 #include <saga/saga/detail/call.hpp> 00015 00016 #include <saga/saga/detail/permissions_impl.hpp> 00017 00019 namespace saga { 00020 namespace rpc { 00021 00022 rpc::rpc (session const& s, saga::url name) 00023 : saga::object (new saga::impl::rpc (s, name)) 00024 { 00025 this->saga::object::get_impl()->init(); 00026 } 00027 00028 rpc::rpc (saga::url name) 00029 : saga::object (new saga::impl::rpc (detail::get_the_session (), name)) 00030 { 00031 this->saga::object::get_impl()->init(); 00032 } 00033 00034 rpc::rpc (saga::impl::rpc *impl) 00035 : saga::object (impl) 00036 { 00037 } 00038 00039 rpc::rpc (void) 00040 { 00041 } 00042 00043 rpc::~rpc (void) 00044 { 00045 } 00046 00047 saga::impl::rpc* rpc::get_impl() const 00048 { 00049 typedef saga::object base_type; 00050 return static_cast<saga::impl::rpc*>(this->base_type::get_impl()); 00051 } 00052 00053 TR1::shared_ptr <saga::impl::rpc> rpc::get_impl_sp(void) const 00054 { 00055 // FIXME: this needs documentation 00056 typedef saga::object base_type; 00057 return TR1::static_pointer_cast <saga::impl::rpc>( 00058 this->base_type::get_impl_sp()); 00059 } 00060 00061 // factory 00062 SAGA_CALL_CREATE_IMP_2(rpc, impl::rpc, session const&, saga::url) 00063 00064 SAGA_CALL_IMP_1(rpc, call, std::vector<parameter>&) 00065 SAGA_CALL_IMP_1(rpc, close, double) 00066 00067 } 00068 00069 namespace detail 00070 { 00072 // implement the permissions functions (we need to explicitly specialize 00073 // the template because the functions are not implemented inline) 00074 template struct SAGA_RPC_PACKAGE_EXPORT permissions<rpc::rpc>; 00075 } 00076 00078 } // namespace saga 00079