Skip to content

Commit

Permalink
fix: correct typo attachement to attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed Nov 19, 2024
1 parent 09798c3 commit b6df66c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/detail/attachment_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace rmw_zenoh_cpp
{

attachement_data_t::attachement_data_t(
attachment_data_t::attachment_data_t(
const int64_t _sequence_number,
const int64_t _source_timestamp,
const uint8_t _source_gid[RMW_GID_STORAGE_SIZE])
Expand All @@ -37,14 +37,14 @@ attachement_data_t::attachement_data_t(
memcpy(source_gid, _source_gid, RMW_GID_STORAGE_SIZE);
}

attachement_data_t::attachement_data_t(attachement_data_t && data)
attachment_data_t::attachment_data_t(attachment_data_t && data)
{
sequence_number = std::move(data.sequence_number);
source_timestamp = std::move(data.source_timestamp);
memcpy(source_gid, data.source_gid, RMW_GID_STORAGE_SIZE);
}

void attachement_data_t::serialize_to_zbytes(z_owned_bytes_t * attachment)
void attachment_data_t::serialize_to_zbytes(z_owned_bytes_t * attachment)
{
ze_owned_serializer_t serializer;
ze_serializer_empty(&serializer);
Expand All @@ -57,7 +57,7 @@ void attachement_data_t::serialize_to_zbytes(z_owned_bytes_t * attachment)
ze_serializer_finish(z_move(serializer), attachment);
}

attachement_data_t::attachement_data_t(const z_loaned_bytes_t * attachment)
attachment_data_t::attachment_data_t(const z_loaned_bytes_t * attachment)
{
ze_deserializer_t deserializer = ze_deserializer_from_bytes(attachment);
z_owned_string_t key;
Expand Down
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/detail/attachment_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
namespace rmw_zenoh_cpp
{

class attachement_data_t final
class attachment_data_t final
{
public:
explicit attachement_data_t(
explicit attachment_data_t(
const int64_t _sequence_number,
const int64_t _source_timestamp,
const uint8_t _source_gid[RMW_GID_STORAGE_SIZE]);
explicit attachement_data_t(const z_loaned_bytes_t *);
explicit attachement_data_t(attachement_data_t && data);
explicit attachment_data_t(const z_loaned_bytes_t *);
explicit attachment_data_t(attachment_data_t && data);

int64_t sequence_number;
int64_t source_timestamp;
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ rmw_ret_t ClientData::take_response(
}

// Fill in the request_header
rmw_zenoh_cpp::attachement_data_t attachment(z_sample_attachment(sample));
rmw_zenoh_cpp::attachment_data_t attachment(z_sample_attachment(sample));
request_header->request_id.sequence_number = attachment.sequence_number;
if (request_header->request_id.sequence_number < 0) {
RMW_SET_ERROR_MSG("Failed to get sequence_number from client call attachment");
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ rmw_ret_t ServiceData::take_request(

// Fill in the request header.
// Get the sequence_number out of the attachment
rmw_zenoh_cpp::attachement_data_t attachment(z_query_attachment(loaned_query));
rmw_zenoh_cpp::attachment_data_t attachment(z_query_attachment(loaned_query));

request_header->request_id.sequence_number = attachment.sequence_number;
if (request_header->request_id.sequence_number < 0) {
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void sub_data_handler(z_loaned_sample_t * sample, void * data)
return;
}

attachement_data_t attachment(z_sample_attachment(sample));
attachment_data_t attachment(z_sample_attachment(sample));
const z_loaned_bytes_t * payload = z_sample_payload(sample);

z_owned_slice_t slice;
Expand All @@ -78,7 +78,7 @@ void sub_data_handler(z_loaned_sample_t * sample, void * data)
SubscriptionData::Message::Message(
z_owned_slice_t p,
uint64_t recv_ts,
attachement_data_t && attachment_)
attachment_data_t && attachment_)
: payload(p), recv_timestamp(recv_ts), attachment(std::move(attachment_))
{
}
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ class SubscriptionData final : public std::enable_shared_from_this<SubscriptionD
explicit Message(
z_owned_slice_t p,
uint64_t recv_ts,
attachement_data_t && attachment);
attachment_data_t && attachment);

~Message();

z_owned_slice_t payload;
uint64_t recv_timestamp;
attachement_data_t attachment;
attachment_data_t attachment;
};

// Make a shared_ptr of SubscriptionData.
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/zenoh_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void create_map_and_set_sequence_num(
auto now_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(now);
int64_t source_timestamp = now_ns.count();

rmw_zenoh_cpp::attachement_data_t data(sequence_number, source_timestamp, gid);
rmw_zenoh_cpp::attachment_data_t data(sequence_number, source_timestamp, gid);
data.serialize_to_zbytes(out_bytes);
}

Expand Down

0 comments on commit b6df66c

Please sign in to comment.