Commit 49ef27b1 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

added default constructor to remote_procedure class

parent 0f3aceea
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <thallium/packed_response.hpp> #include <thallium/packed_response.hpp>
#include <thallium/serialization/proc_output_archive.hpp> #include <thallium/serialization/proc_output_archive.hpp>
#include <thallium/serialization/serialize.hpp> #include <thallium/serialization/serialize.hpp>
#include <thallium/serialization/stl/vector.hpp>
#include <thallium/timeout.hpp> #include <thallium/timeout.hpp>
#include <tuple> #include <tuple>
#include <utility> #include <utility>
......
...@@ -30,7 +30,7 @@ class remote_procedure { ...@@ -30,7 +30,7 @@ class remote_procedure {
private: private:
std::weak_ptr<detail::engine_impl> m_engine_impl; std::weak_ptr<detail::engine_impl> m_engine_impl;
hg_id_t m_id; hg_id_t m_id = 0;
bool m_ignore_response; bool m_ignore_response;
/** /**
...@@ -46,6 +46,9 @@ class remote_procedure { ...@@ -46,6 +46,9 @@ class remote_procedure {
, m_ignore_response(false) {} , m_ignore_response(false) {}
public: public:
remote_procedure() = default;
/** /**
* @brief Copy-constructor is default. * @brief Copy-constructor is default.
*/ */
...@@ -117,32 +120,30 @@ class remote_procedure { ...@@ -117,32 +120,30 @@ class remote_procedure {
namespace thallium { namespace thallium {
#if 0
inline remote_procedure::remote_procedure(std::weak_ptr<detail::engine_impl> e, hg_id_t id)
: m_engine_impl(std::move(e))
, m_id(id)
, m_ignore_response(false) {}
#endif
inline callable_remote_procedure remote_procedure::on(const endpoint& ep) const { inline callable_remote_procedure remote_procedure::on(const endpoint& ep) const {
if(m_id == 0)
throw exception("remote_procedure object isn't initialized");
return callable_remote_procedure(m_engine_impl, m_id, ep, m_ignore_response); return callable_remote_procedure(m_engine_impl, m_id, ep, m_ignore_response);
} }
inline callable_remote_procedure inline callable_remote_procedure
remote_procedure::on(const provider_handle& ph) const { remote_procedure::on(const provider_handle& ph) const {
if(m_id == 0)
throw exception("remote_procedure object isn't initialized");
return callable_remote_procedure(m_engine_impl, m_id, ph, m_ignore_response, return callable_remote_procedure(m_engine_impl, m_id, ph, m_ignore_response,
ph.provider_id()); ph.provider_id());
} }
inline void remote_procedure::deregister() { inline void remote_procedure::deregister() {
auto engine_impl = m_engine_impl.lock(); auto engine_impl = m_engine_impl.lock();
if(!engine_impl) throw exception("Invalid engine"); if(engine_impl)
margo_deregister(engine_impl->m_mid, m_id); margo_deregister(engine_impl->m_mid, m_id);
} }
inline remote_procedure& remote_procedure::disable_response() { inline remote_procedure& remote_procedure::disable_response() {
m_ignore_response = true; m_ignore_response = true;
auto engine_impl = m_engine_impl.lock(); auto engine_impl = m_engine_impl.lock();
if(!engine_impl) throw exception("Invalid engine"); if(!engine_impl) throw exception("remote_procedure object isn't initialized");
margo_registered_disable_response(engine_impl->m_mid, m_id, HG_TRUE); margo_registered_disable_response(engine_impl->m_mid, m_id, HG_TRUE);
return *this; return *this;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment