Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
atsushi421 committed Nov 28, 2024
1 parent 75ee6bb commit 53f81c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/agnocastlib/include/agnocast_smart_pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/agnocastlib/include/agnocast_topic_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TypedMessagePtr<MessageType>>(agnocast::ipc_shared_ptr<MessageType>(
const_cast<MessageType *>(static_cast<const MessageType *>(ptr)), topic_name, publisher_pid,
timestamp, need_rc_update));
timestamp, is_created_by_borrow));
};

uint32_t id = agnocast_topic_next_id.fetch_add(1);
Expand Down
4 changes: 2 additions & 2 deletions src/agnocastlib/test/test_agnocast_smart_pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> sut{new int(0), dummy_tn, dummy_pid, dummy_ts, false};
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 53f81c1

Please sign in to comment.