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
fdf36fd4
Commit
fdf36fd4
authored
Mar 04, 2019
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added get_addr in endpoint
parent
532e5885
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
include/thallium/endpoint.hpp
include/thallium/endpoint.hpp
+12
-0
src/endpoint.cpp
src/endpoint.cpp
+11
-1
No files found.
include/thallium/endpoint.hpp
View file @
fdf36fd4
...
...
@@ -102,6 +102,18 @@ public:
return
m_addr
==
HG_ADDR_NULL
;
}
/**
* @brief Returns the underlying Mercury address.
*
* @param copy If set to true, a copy of the address will be made.
* (the user will be responsible for calling margo_addr_free on this
* address) Otherwise, the hg_addr_t returned is the one managed by
* the endpoint instance and will be deleted when this enpoint is destroyed.
*
* @return The underlying hg_addr_t.
*/
hg_addr_t
get_addr
(
bool
copy
=
false
)
const
;
template
<
typename
S
>
friend
S
&
::
operator
<<
(
S
&
s
,
const
endpoint
&
e
);
};
...
...
src/endpoint.cpp
View file @
fdf36fd4
...
...
@@ -78,7 +78,17 @@ endpoint::operator std::string() const {
ret
=
margo_addr_to_string
(
m_engine
->
m_mid
,
&
result
[
0
],
&
size
,
m_addr
);
MARGO_ASSERT
(
ret
,
margo_addr_to_string
);
return
std
::
string
(
result
.
data
());
}
}
hg_addr_t
endpoint
::
get_addr
(
bool
copy
)
const
{
if
(
!
copy
||
m_addr
==
HG_ADDR_NULL
)
return
m_addr
;
if
(
m_engine
==
nullptr
)
return
HG_ADDR_NULL
;
hg_addr_t
new_addr
;
hg_return_t
ret
=
margo_addr_dup
(
m_engine
->
get_margo_instance
(),
m_addr
,
&
new_addr
);
// TODO throw an exception if the call fails
if
(
ret
!=
HG_SUCCESS
)
return
HG_ADDR_NULL
;
return
new_addr
;
}
}
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