Commit d88a7f24 authored by Matthieu Dorier's avatar Matthieu Dorier

added access to underlying bulk handle

parent 84e78d11
......@@ -318,6 +318,19 @@ public:
*/
std::size_t operator<<(const remote_bulk& b) const;
/**
* @brief Returns the underlying hg_bulk_t handle.
* If copy == false, the returned handle is a reference to the internal
* handle managed by this bulk object, it should not be destroyed by the
* user and its lifetime will not exceed that of the bulk object.
* If copy == true, the returned handle should be destroyed by the user.
*
* @param copy whether to make a copy or not.
*
* @return The underlying hg_bulk_t handle.
*/
hg_bulk_t get_bulk(bool copy=false) const;
/**
* @brief Function that serializes a bulk object into an archive.
*
......
......@@ -8,6 +8,12 @@
namespace thallium {
hg_bulk_t bulk::get_bulk(bool copy=false) const {
if(copy && m_bulk != HG_BULK_NULL)
margo_bulk_ref_incr(m_bulk);
return m_bulk;
}
bulk::bulk_segment bulk::select(std::size_t offset, std::size_t size) const {
return bulk_segment(*this, offset, size);
}
......
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