Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
thallium
Commits
f1f532cf
Commit
f1f532cf
authored
Nov 22, 2017
by
Matthieu Dorier
Browse files
started integrating serialization
parent
f71d04a2
Changes
1
Show whitespace changes
Inline
Side-by-side
include/thallium/callable_remote_procedure.hpp
View file @
f1f532cf
...
...
@@ -3,8 +3,11 @@
#include <tuple>
#include <cstdint>
#include <utility>
#include <margo.h>
#include <thallium/buffer.hpp>
#include <thallium/serialization/stl/vector.hpp>
#include <thallium/serialization/buffer_output_archive.hpp>
namespace
thallium
{
...
...
@@ -22,6 +25,15 @@ private:
callable_remote_procedure
(
hg_id_t
id
,
const
endpoint
&
ep
,
bool
ignore_resp
);
auto
forward
(
const
buffer
&
buf
)
const
{
margo_forward
(
m_handle
,
const_cast
<
void
*>
(
static_cast
<
const
void
*>
(
&
buf
)));
buffer
output
;
if
(
m_ignore_response
)
return
output
;
margo_get_output
(
m_handle
,
&
output
);
margo_free_output
(
m_handle
,
&
output
);
// won't do anything on a buffer type
return
output
;
}
public:
callable_remote_procedure
(
const
callable_remote_procedure
&
other
)
{
...
...
@@ -69,30 +81,11 @@ public:
}
template
<
typename
...
T
>
auto
operator
()(
const
T
&
...
t
)
const
{
// TODO throw an exception if handle is null
// buffer input;
// BufferOutputArchive arch(input);
// serialize_many(arch, std::forward<T>(t)...);
// serialize(std::forward<T>(t)
// auto input = std::tie(t...);
margo_forward
(
m_handle
,
nullptr
);
// Buffer output;
//margo_get_output(m_handle, &output);
return
true
;
//Pack(std::move(output));
}
auto
operator
()(
const
buffer
&
buf
)
const
{
margo_forward
(
m_handle
,
const_cast
<
void
*>
(
static_cast
<
const
void
*>
(
&
buf
)));
buffer
output
;
if
(
m_ignore_response
)
return
output
;
margo_get_output
(
m_handle
,
&
output
);
margo_free_output
(
m_handle
,
&
output
);
// won't do anything on a buffer type
return
output
;
auto
operator
()(
T
&&
...
t
)
const
{
buffer
b
;
buffer_output_archive
arch
(
b
);
serialize_many
(
arch
,
std
::
forward
<
T
>
(
t
)...);
return
forward
(
b
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment