Skip to content

Commit

Permalink
[core] redesign service server api (#1849)
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky authored Dec 13, 2024
1 parent d7a868b commit 9cdfe52
Show file tree
Hide file tree
Showing 47 changed files with 1,414 additions and 1,052 deletions.
5 changes: 4 additions & 1 deletion ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ if(ECAL_CORE_SERVICE)
src/service/ecal_service_server.cpp
src/service/ecal_service_server_impl.cpp
src/service/ecal_service_server_impl.h
src/service/ecal_service_server_v5.cpp
src/service/ecal_service_server_v5_impl.cpp
src/service/ecal_service_server_v5_impl.h
src/service/ecal_service_singleton_manager.cpp
src/service/ecal_service_singleton_manager.h
)
Expand Down Expand Up @@ -511,7 +514,6 @@ set(ecal_header_cmn
include/ecal/config/monitoring.h
include/ecal/config/publisher.h
include/ecal/config/registration.h
include/ecal/config/service.h
include/ecal/config/subscriber.h
include/ecal/config/time.h
include/ecal/config/transport_layer.h
Expand All @@ -537,6 +539,7 @@ set(ecal_header_cmn
include/ecal/ecal_registration.h
include/ecal/ecal_publisher.h
include/ecal/ecal_server.h
include/ecal/ecal_server_v5.h
include/ecal/ecal_service_info.h
include/ecal/ecal_subscriber.h
include/ecal/ecal_time.h
Expand Down
2 changes: 0 additions & 2 deletions ecal/core/include/ecal/config/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <ecal/config/application.h>
#include <ecal/config/monitoring.h>
#include <ecal/config/registration.h>
#include <ecal/config/service.h>
#include <ecal/config/logging.h>
#include <ecal/config/user_arguments.h>
#include <ecal/config/publisher.h>
Expand All @@ -54,7 +53,6 @@ namespace eCAL
Subscriber::Configuration subscriber;
Publisher::Configuration publisher;
Time::Configuration timesync;
Service::Configuration service;
Application::Configuration application;
Logging::Configuration logging;
Cli::Configuration command_line_arguments;
Expand Down
39 changes: 0 additions & 39 deletions ecal/core/include/ecal/config/service.h

This file was deleted.

39 changes: 33 additions & 6 deletions ecal/core/include/ecal/ecal_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@

#include <ecal/ecal_deprecate.h>
#include <ecal/ecal_os.h>

#include <ecal/ecal_callback.h>
#include <ecal/ecal_service_info.h>
#include <ecal/ecal_client_instance.h>
#include <ecal/ecal_service_info.h>
#include <ecal/ecal_types.h>

#include <memory>
#include <string>
Expand Down Expand Up @@ -62,13 +64,27 @@ namespace eCAL
ECAL_API_EXPORTED_MEMBER
virtual ~CServiceClient();

// Deleted copy constructor and copy assignment operator
/**
* @brief CServiceClient are non-copyable
**/
CServiceClient(const CServiceClient&) = delete;

/**
* @brief CServiceClient are non-copyable
**/
CServiceClient& operator=(const CServiceClient&) = delete;

// Move constructor and move assignment operator
ECAL_API_EXPORTED_MEMBER CServiceClient(CServiceClient&& rhs) noexcept;
ECAL_API_EXPORTED_MEMBER CServiceClient& operator=(CServiceClient&& rhs) noexcept;
/**
* @brief CServiceClient are move-enabled
**/
ECAL_API_EXPORTED_MEMBER
CServiceClient(CServiceClient&& rhs) noexcept;

/**
* @brief CServiceClient are move-enabled
**/
ECAL_API_EXPORTED_MEMBER
CServiceClient& operator=(CServiceClient&& rhs) noexcept;

/**
* @brief Get the client instances for all matching services
Expand Down Expand Up @@ -124,6 +140,17 @@ namespace eCAL
ECAL_API_EXPORTED_MEMBER
std::string GetServiceName() const;

/**
* @brief Retrieve the service id.
*
* @return The service id.
**/

// TODO: Implement this

ECAL_API_EXPORTED_MEMBER
Registration::SServiceMethodId GetServiceId() const;

/**
* @brief Check connection to at least one service.
*
Expand All @@ -136,4 +163,4 @@ namespace eCAL
std::shared_ptr<eCAL::CServiceClientImpl> m_service_client_impl;
};
}
}
}
2 changes: 1 addition & 1 deletion ecal/core/include/ecal/ecal_client_v5.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ namespace eCAL
ECAL_API_EXPORTED_MEMBER
bool IsConnected();

protected:
private:
std::shared_ptr<CServiceClientImpl> m_service_client_impl;
};
}
Expand Down
9 changes: 2 additions & 7 deletions ecal/core/include/ecal/ecal_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace eCAL
ECAL_API Configuration& GetConfiguration ();
ECAL_API Subscriber::Configuration& GetSubscriberConfiguration ();
ECAL_API Publisher::Configuration& GetPublisherConfiguration ();
ECAL_API Service::Configuration& GetServiceConfiguration ();

namespace Config
{
Expand Down Expand Up @@ -103,18 +102,14 @@ namespace eCAL
/////////////////////////////////////
// publisher
/////////////////////////////////////

ECAL_API bool IsTopicTypeSharingEnabled ();
ECAL_API bool IsTopicDescriptionSharingEnabled ();

/////////////////////////////////////
// service
/////////////////////////////////////
ECAL_API bool IsServiceProtocolV0Enabled ();
ECAL_API bool IsServiceProtocolV1Enabled ();

/////////////////////////////////////
// subscriber
/////////////////////////////////////

ECAL_API bool GetDropOutOfOrderMessages ();

/////////////////////////////////////
Expand Down
Loading

0 comments on commit 9cdfe52

Please sign in to comment.