Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thallium
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
thallium
Commits
da3cb122
Commit
da3cb122
authored
May 28, 2019
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added subsegment selection and selection from remote_bulk
parent
0f1eb55f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
0 deletions
+71
-0
include/thallium/bulk.hpp
include/thallium/bulk.hpp
+31
-0
include/thallium/remote_bulk.hpp
include/thallium/remote_bulk.hpp
+40
-0
No files found.
include/thallium/bulk.hpp
View file @
da3cb122
...
...
@@ -91,6 +91,16 @@ private:
*/
bulk_segment
(
bulk_segment
&&
)
=
default
;
/**
* @brief Copy assignment operator is default.
*/
bulk_segment
&
operator
=
(
const
bulk_segment
&
)
=
default
;
/**
* @brief Move assignment operator is default.
*/
bulk_segment
&
operator
=
(
bulk_segment
&&
)
=
default
;
/**
* @brief Destructor is default.
*/
...
...
@@ -127,6 +137,27 @@ private:
* @return the size of data transfered.
*/
std
::
size_t
operator
<<
(
const
remote_bulk
&
b
)
const
;
/**
* @brief Selects a subsegment from this segment. If the size is too large,
* the maximum possible size is chosen.
*
* @param offset Offset of the subsegment relative to the current segment.
* @param size Size of the subsegment.
*
* @return a new bulk_segment object.
*/
bulk_segment
select
(
std
::
size_t
offset
,
std
::
size_t
size
)
const
{
std
::
size_t
effective_size
=
offset
+
size
>
m_size
?
m_size
-
offset
:
size
;
return
bulk_segment
(
m_bulk
,
m_offset
+
offset
,
effective_size
);
}
/**
* @see bulk_segment::select.
*/
inline
bulk_segment
operator
()(
std
::
size_t
offset
,
std
::
size_t
size
)
const
{
return
select
(
offset
,
size
);
}
};
public:
...
...
include/thallium/remote_bulk.hpp
View file @
da3cb122
...
...
@@ -41,6 +41,26 @@ private:
public:
/**
* @brief Default copy constructor.
*/
remote_bulk
(
const
remote_bulk
&
)
=
default
;
/**
* @brief Default move constructor.
*/
remote_bulk
(
remote_bulk
&&
)
=
default
;
/**
* @brief Default copy-assignment operator.
*/
remote_bulk
&
operator
=
(
const
remote_bulk
&
)
=
default
;
/**
* @brief Default move-assignment operator.
*/
remote_bulk
&
operator
=
(
remote_bulk
&&
)
=
default
;
/**
* @brief Performs a pull operation from the remote_bulk
* (left operand) to the destination bulk (right operand).
...
...
@@ -64,6 +84,26 @@ public:
* @return the size of data transfered.
*/
std
::
size_t
operator
<<
(
const
bulk
::
bulk_segment
&
src
)
const
;
/**
* @brief Creates a bulk_segment object by selecting a given portion
* of the bulk object given an offset and a size.
*
* @param offset Offset at which the segment starts.
* @param size Size of the segment.
*
* @return a bulk_segment object.
*/
remote_bulk
select
(
std
::
size_t
offset
,
std
::
size_t
size
)
const
{
return
remote_bulk
(
m_segment
.
select
(
offset
,
size
),
m_endpoint
);
}
/**
* @see remote_bulk::select
*/
inline
remote_bulk
operator
()(
std
::
size_t
offset
,
std
::
size_t
size
)
const
{
return
select
(
offset
,
size
);
}
};
}
...
...
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