Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
pass context to wait set and fini context (#257)
Browse files Browse the repository at this point in the history
* pass context to wait set and fini context

Signed-off-by: William Woodall <william@osrfoundation.org>

* use nullptr in C++
  • Loading branch information
wjwwood authored Jan 25, 2019
1 parent 6a76754 commit 0de412c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
14 changes: 14 additions & 0 deletions rmw_opensplice_cpp/src/rmw_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ rmw_init(const rmw_init_options_t * options, rmw_context_t * context)

rmw_ret_t
rmw_shutdown(rmw_context_t * context)
{
RCUTILS_CHECK_ARGUMENT_FOR_NULL(context, RMW_RET_INVALID_ARGUMENT);
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
context,
context->implementation_identifier,
opensplice_cpp_identifier,
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
// Nothing to do here for now.
// This is just the middleware's notification that shutdown was called.
return RMW_RET_OK;
}

rmw_ret_t
rmw_context_fini(rmw_context_t * context)
{
RCUTILS_CHECK_ARGUMENT_FOR_NULL(context, RMW_RET_INVALID_ARGUMENT);
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
Expand Down
10 changes: 9 additions & 1 deletion rmw_opensplice_cpp/src/rmw_wait_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@
extern "C"
{
rmw_wait_set_t *
rmw_create_wait_set(size_t max_conditions)
rmw_create_wait_set(rmw_context_t * context, size_t max_conditions)
{
RCUTILS_CHECK_ARGUMENT_FOR_NULL(context, NULL);
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
init context,
context->implementation_identifier,
opensplice_cpp_identifier,
// TODO(wjwwood): replace this with RMW_RET_INCORRECT_RMW_IMPLEMENTATION when refactored
return nullptr);

rmw_wait_set_t * wait_set = rmw_wait_set_allocate();
OpenSpliceWaitSetInfo * wait_set_info = nullptr;

Expand Down

0 comments on commit 0de412c

Please sign in to comment.