Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Change entity_id type from std::string to uint64_t #1872

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

KerstinKeller
Copy link
Contributor

@KerstinKeller KerstinKeller commented Jan 2, 2025

Functional change: change map IDs from combined strings to entity_id only (as they are unique within the system)

The serialization format is kept as is for binary compatibility. E.g. while internally being handled as uint64_t, it is converted to a string on the wire, and parsed from the string upon deserialization.

Please review with regard to the following:
Name of EntityID type: using EntityIdT = uint64_t; or rather TEntityID (similar to SEntityID -> bit unhappy about naming here)

@KerstinKeller KerstinKeller added the cherry-pick-to-NONE Don't cherry-pick these changes label Jan 2, 2025
Copy link
Contributor

@hannemn hannemn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@KerstinKeller KerstinKeller changed the title [core] monitoring map indices based solely on entity ids [core] Change entity_id type from std::string to uint64_t Jan 3, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -23,9 +23,10 @@
**/

#pragma once
#include <cstdint>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'cstdint' file not found [clang-diagnostic-error]

#include <cstdint>
         ^

if (arg == nullptr) return false;
if (*arg == nullptr) return false;

size_t len = stream->bytes_left;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'len' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]

Suggested change
size_t len = stream->bytes_left;
size_t const len = stream->bytes_left;

@@ -37,7 +37,7 @@ namespace eCAL
std::string host_name;
int32_t process_id = 0;
std::string topic_name;
std::string topic_id;
uint64_t topic_id = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use here uint64_t while we have down below in AddSubscription/RemSubscription the Registration::EntityIdT ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-to-NONE Don't cherry-pick these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants