diff --git a/src/agnocastlib/include/agnocast_smart_pointer.hpp b/src/agnocastlib/include/agnocast_smart_pointer.hpp index a351cd04..fa82b6ae 100644 --- a/src/agnocastlib/include/agnocast_smart_pointer.hpp +++ b/src/agnocastlib/include/agnocast_smart_pointer.hpp @@ -55,12 +55,12 @@ class ipc_shared_ptr explicit ipc_shared_ptr( T * ptr, const std::string & topic_name, uint32_t publisher_pid, uint64_t timestamp, - bool need_rc_update) + bool is_created_by_borrow) : ptr_(ptr), topic_name_(topic_name), publisher_pid_(publisher_pid), timestamp_(timestamp), - is_created_by_borrow_(need_rc_update) + is_created_by_borrow_(is_created_by_borrow) { } diff --git a/src/agnocastlib/include/agnocast_topic_info.hpp b/src/agnocastlib/include/agnocast_topic_info.hpp index 42ab7d43..d033ccf7 100644 --- a/src/agnocastlib/include/agnocast_topic_info.hpp +++ b/src/agnocastlib/include/agnocast_topic_info.hpp @@ -109,10 +109,10 @@ void register_callback( auto message_creator = []( const void * ptr, const std::string & topic_name, const uint32_t publisher_pid, const uint64_t timestamp, - const bool need_rc_update) { + const bool is_created_by_borrow) { return std::make_unique>(agnocast::ipc_shared_ptr( const_cast(static_cast(ptr)), topic_name, publisher_pid, - timestamp, need_rc_update)); + timestamp, is_created_by_borrow)); }; uint32_t id = agnocast_topic_next_id.fetch_add(1); diff --git a/src/agnocastlib/test/test_agnocast_smart_pointer.cpp b/src/agnocastlib/test/test_agnocast_smart_pointer.cpp index ff972df5..16071313 100644 --- a/src/agnocastlib/test/test_agnocast_smart_pointer.cpp +++ b/src/agnocastlib/test/test_agnocast_smart_pointer.cpp @@ -31,7 +31,7 @@ TEST_F(AgnocastSmartPointerTest, reset_normal) EXPECT_EQ(nullptr, sut.get()); } -TEST_F(AgnocastSmartPointerTest, reset_dont_need_rc_update) +TEST_F(AgnocastSmartPointerTest, reset_isnt_created_by_borrow) { EXPECT_GLOBAL_CALL(decrement_rc, decrement_rc(dummy_tn, dummy_pid, dummy_ts)).Times(0); agnocast::ipc_shared_ptr sut{new int(0), dummy_tn, dummy_pid, dummy_ts, false}; @@ -61,7 +61,7 @@ TEST_F(AgnocastSmartPointerTest, copy_constructor_normal) EXPECT_EQ(sut.get_timestamp(), sut2.get_timestamp()); } -TEST_F(AgnocastSmartPointerTest, copy_constructor_dont_need_rc_update) +TEST_F(AgnocastSmartPointerTest, copy_constructor_isnt_created_by_borrow) { EXPECT_GLOBAL_CALL(increment_rc_core, increment_rc_core(dummy_tn, dummy_pid, dummy_ts)).Times(0); EXPECT_GLOBAL_CALL(decrement_rc, decrement_rc(dummy_tn, dummy_pid, dummy_ts)).Times(0);