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] separate unytyped msg client #2028

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

rex-schilasky
Copy link
Contributor

Description

This pull request introduces several renaming and reorganization changes to improve clarity and consistency within the protobuf client interfaces:

Renaming Changes:

  • Typed Clients:
    • eCAL::protobuf::CServiceClientTyped → eCAL::protobuf::CServiceClient
    • eCAL::protobuf::CClientInstanceTyped → eCAL::protobuf::CClientInstance
  • Untyped Clients:
    • eCAL::protobuf::CServiceClient → eCAL::protobuf::CServiceClientUntyped
    • eCAL::protobuf::CClientInstance → eCAL::protobuf::CClientInstanceUntyped

Reorganization:

  • The untyped versions have been moved into dedicated header files:
    • client_untyped.h
    • client_untyped_instance.h

Additional Improvements:

  • Updated and harmonized the comments and documentation in all four files.
  • The untyped response versions are retained for now to simplify migration and reduce testing effort for current applications and samples based on untyped responses.

These changes provide a clearer separation between typed and untyped client interfaces, easing future maintenance and migration efforts.

@rex-schilasky rex-schilasky added the cherry-pick-to-NONE Don't cherry-pick these changes label Feb 14, 2025
@rex-schilasky rex-schilasky added this to the eCAL 6.0 milestone Feb 14, 2025
Copy link
Contributor

@KerstinKeller KerstinKeller left a comment

Choose a reason for hiding this comment

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

That's better!

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


static eCAL::rec::Error CallRemoteEcalrecService(const std::shared_ptr<eCAL::protobuf::CServiceClient<eCAL::pb::rec_server::EcalRecServerService>>& remote_ecalsys_service
static eCAL::rec::Error CallRemoteEcalrecService(const std::shared_ptr<eCAL::protobuf::CServiceClientUntyped<eCAL::pb::rec_server::EcalRecServerService>>& remote_ecalsys_service
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'eCAL::rec_cli::command::Command::CallRemoteEcalrecService' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

        static eCAL::rec::Error CallRemoteEcalrecService(const std::shared_ptr<eCAL::protobuf::CServiceClientUntyped<eCAL::pb::rec_server::EcalRecServerService>>& remote_ecalsys_service
                                ^
Additional context

app/rec/rec_server_cli/src/commands/command.cpp:75: the definition seen here

      eCAL::rec::Error Command::CallRemoteEcalrecService(const std::shared_ptr<eCAL::protobuf::CServiceClientUntyped<eCAL::pb::rec_server::EcalRecServerService>>& remote_ecalrec_service
                                ^

app/rec/rec_server_cli/src/commands/command.h:63: differing parameters are named here: ('remote_ecalsys_service'), in definition: ('remote_ecalrec_service')

        static eCAL::rec::Error CallRemoteEcalrecService(const std::shared_ptr<eCAL::protobuf::CServiceClientUntyped<eCAL::pb::rec_server::EcalRecServerService>>& remote_ecalsys_service
                                ^

@@ -119,7 +119,7 @@ bool IsBuiltInFtpServerBusy(bool print_status = false);

// Rec Sever instance and rec_server_service. We will only use one of those, depending on the remote-control setting
std::shared_ptr<eCAL::rec_server::RecServer> rec_server_instance;
std::shared_ptr<eCAL::protobuf::CServiceClient<eCAL::pb::rec_server::EcalRecServerService>> remote_rec_server_service;
std::shared_ptr<eCAL::protobuf::CServiceClientUntyped<eCAL::pb::rec_server::EcalRecServerService>> remote_rec_server_service;
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 'remote_rec_server_service' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]

std::shared_ptr<eCAL::protobuf::CServiceClientUntyped<eCAL::pb::rec_server::EcalRecServerService>> remote_rec_server_service;
                                                                                                   ^

@@ -22,7 +22,7 @@
#pragma warning(push)
#pragma warning(disable: 4100 4127 4146 4505 4800 4189 4592) // disable proto warnings
#endif
#include <ecal/msg/protobuf/client.h>
#include <ecal/msg/protobuf/client_untyped.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 'ecal/msg/protobuf/client_untyped.h' file not found [clang-diagnostic-error]

#include <ecal/msg/protobuf/client_untyped.h>
         ^

@@ -92,7 +92,7 @@ int main()
eCAL::Initialize("ecalplayer client");

// create player service client
eCAL::protobuf::CServiceClient<eCAL::pb::play::EcalPlayService> player_service;
eCAL::protobuf::CServiceClientUntyped<eCAL::pb::play::EcalPlayService> player_service;
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 'player_service' of type 'eCAL::protobuf::CServiceClientUntypedeCAL::pb::play::EcalPlayService' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::protobuf::CServiceClientUntyped<eCAL::pb::play::EcalPlayService> player_service;
eCAL::protobuf::CServiceClientUntyped<eCAL::pb::play::EcalPlayService> const player_service;

@@ -69,7 +69,7 @@ int main()
eCAL::Initialize("ecalsys client");

// create player service client
eCAL::protobuf::CServiceClient<eCAL::pb::sys::Service> sys_service;
eCAL::protobuf::CServiceClientUntyped<eCAL::pb::sys::Service> sys_service;
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 'sys_service' of type 'eCAL::protobuf::CServiceClientUntypedeCAL::pb::sys::Service' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::protobuf::CServiceClientUntyped<eCAL::pb::sys::Service> sys_service;
eCAL::protobuf::CServiceClientUntyped<eCAL::pb::sys::Service> const sys_service;


#pragma once

#include <ecal/service/client.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 'ecal/service/client.h' file not found [clang-diagnostic-error]

           ^


#pragma once

#include <ecal/service/client_instance.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 'ecal/service/client_instance.h' file not found [clang-diagnostic-error]

#include <ecal/service/client_instance.h>
         ^

{
public:
// Constructors
CClientInstanceUntyped(eCAL::CClientInstance&& base_instance_) noexcept
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: constructor does not initialize these fields: m_instance [cppcoreguidelines-pro-type-member-init]

serialization/protobuf/protobuf/include/ecal/msg/protobuf/client_untyped_instance.h:153:

-       eCAL::CClientInstance m_instance;
+       eCAL::CClientInstance m_instance{};

{
public:
// Constructors
CClientInstanceUntyped(eCAL::CClientInstance&& base_instance_) noexcept
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: rvalue reference parameter 'base_instance_' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]

      CClientInstanceUntyped(eCAL::CClientInstance&& base_instance_) noexcept
                                                     ^

{
}

CClientInstanceUntyped(const SEntityId& entity_id_,
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: constructor does not initialize these fields: m_instance [cppcoreguidelines-pro-type-member-init]

      CClientInstanceUntyped(const SEntityId& entity_id_,
      ^

@rex-schilasky rex-schilasky merged commit 0ecfbee into master Feb 14, 2025
27 of 28 checks passed
@rex-schilasky rex-schilasky deleted the core/separate-unytyped-msg-client branch February 14, 2025 11:44
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.

2 participants