Skip to content

Commit

Permalink
first server implementation
Browse files Browse the repository at this point in the history
service gate aligned with client gate
service configuration removed
  • Loading branch information
rex-schilasky committed Dec 10, 2024
1 parent 9d2bf06 commit 3f9de03
Show file tree
Hide file tree
Showing 17 changed files with 392 additions and 188 deletions.
1 change: 0 additions & 1 deletion ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,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 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.

7 changes: 0 additions & 7 deletions ecal/core/include/ecal/ecal_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace eCAL
ECAL_API Subscriber::Configuration& GetSubscriberConfiguration ();
ECAL_API Publisher::Configuration& GetPublisherConfiguration ();
ECAL_API Time::Configuration& GetTimesyncConfiguration ();
ECAL_API Service::Configuration& GetServiceConfiguration ();
ECAL_API Application::Configuration& GetApplicationConfiguration ();

namespace Config
Expand Down Expand Up @@ -115,12 +114,6 @@ namespace eCAL
ECAL_API bool IsTopicTypeSharingEnabled ();
ECAL_API bool IsTopicDescriptionSharingEnabled ();

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

/////////////////////////////////////
// experimental
/////////////////////////////////////
Expand Down
7 changes: 3 additions & 4 deletions ecal/core/include/ecal/ecal_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ namespace eCAL
/**
* @brief Add method callback.
*
* @param method_ Service method name.
* @param req_type_ Service method request type.
* @param resp_type_ Service method response type.
* @param callback_ Callback function for client request.
* @param method_ Service method name.
* @param method_info_ Service method information (request & response types).
* @param callback_ Callback function for client request.
*
* @return True if successful.
**/
Expand Down
1 change: 0 additions & 1 deletion ecal/core/src/config/configuration_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace
YAML::AssignValue<eCAL::Registration::Configuration>(config_.registration, node_, "registration");
YAML::AssignValue<eCAL::Monitoring::Configuration>(config_.monitoring, node_, "monitoring");
YAML::AssignValue<eCAL::Time::Configuration>(config_.timesync, node_, "time");
YAML::AssignValue<eCAL::Service::Configuration>(config_.service, node_, "service");
YAML::AssignValue<eCAL::Application::Configuration>(config_.application, node_, "application");
YAML::AssignValue<eCAL::Logging::Configuration>(config_.logging, node_, "logging");
}
Expand Down
26 changes: 0 additions & 26 deletions ecal/core/src/config/configuration_to_yaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,30 +492,6 @@ namespace YAML
}


/*
____ _
/ __/__ _____ __(_)______
_\ \/ -_) __/ |/ / / __/ -_)
/___/\__/_/ |___/_/\__/\__/
*/

Node convert<eCAL::Service::Configuration>::encode(const eCAL::Service::Configuration& config_)
{
Node node;
node["protocol_v0"] = config_.protocol_v0;
node["protocol_v1"] = config_.protocol_v1;

return node;
}

bool convert<eCAL::Service::Configuration>::decode(const Node& node_, eCAL::Service::Configuration& config_)
{
AssignValue<bool>(config_.protocol_v0, node_, "protocol_v0");
AssignValue<bool>(config_.protocol_v1, node_, "protocol_v1");
return true;
}


/*
___ ___ __ _
/ _ | ___ ___ / (_)______ _/ /_(_)__ ___
Expand Down Expand Up @@ -681,7 +657,6 @@ namespace YAML
node["registration"] = config_.registration;
node["monitoring"] = config_.monitoring;
node["time"] = config_.timesync;
node["service"] = config_.service;
node["application"] = config_.application;
node["logging"] = config_.logging;
return node;
Expand All @@ -695,7 +670,6 @@ namespace YAML
AssignValue<eCAL::Registration::Configuration>(config_.registration, node_, "registration");
AssignValue<eCAL::Monitoring::Configuration>(config_.monitoring, node_, "monitoring");
AssignValue<eCAL::Time::Configuration>(config_.timesync, node_, "time");
AssignValue<eCAL::Service::Configuration>(config_.service, node_, "service");
AssignValue<eCAL::Application::Configuration>(config_.application, node_, "application");
AssignValue<eCAL::Logging::Configuration>(config_.logging, node_, "logging");
return true;
Expand Down
15 changes: 0 additions & 15 deletions ecal/core/src/config/configuration_to_yaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,6 @@ namespace YAML
};


/*
____ _
/ __/__ _____ __(_)______
_\ \/ -_) __/ |/ / / __/ -_)
/___/\__/_/ |___/_/\__/\__/
*/
template<>
struct convert<eCAL::Service::Configuration>
{
static Node encode(const eCAL::Service::Configuration& config_);

static bool decode(const Node& node_, eCAL::Service::Configuration& config_);
};


/*
___ ___ __ _
/ _ | ___ ___ / (_)______ _/ /_(_)__ ___
Expand Down
8 changes: 0 additions & 8 deletions ecal/core/src/config/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,6 @@ namespace eCAL
ss << R"( replay: )" << quoteString(config_.timesync.timesync_module_replay) << "\n";
ss << R"()" << "\n";
ss << R"()" << "\n";
ss << R"(# Service configuration)" << "\n";
ss << R"(service:)" << "\n";
ss << R"( # Support service protocol v0, eCAL 5.11 and older)" << "\n";
ss << R"( protocol_v0: )" << config_.service.protocol_v0 << "\n";
ss << R"( # Support service protocol v1, eCAL 5.12 and newer)" << "\n";
ss << R"( protocol_v1: )" << config_.service.protocol_v1 << "\n";
ss << R"()" << "\n";
ss << R"()" << "\n";
ss << R"(# eCAL Application Configuration)" << "\n";
ss << R"(application:)" << "\n";
ss << R"( # Configuration for eCAL Sys)" << "\n";
Expand Down
6 changes: 0 additions & 6 deletions ecal/core/src/config/ecal_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ namespace eCAL
bool IsTopicTypeSharingEnabled () { return GetConfiguration().publisher.share_topic_type; }
bool IsTopicDescriptionSharingEnabled () { return GetConfiguration().publisher.share_topic_description; }

/////////////////////////////////////
// service
/////////////////////////////////////
bool IsServiceProtocolV0Enabled () { return GetConfiguration().service.protocol_v0; }
bool IsServiceProtocolV1Enabled () { return GetConfiguration().service.protocol_v1; }

/////////////////////////////////////
// experimemtal
/////////////////////////////////////
Expand Down
5 changes: 0 additions & 5 deletions ecal/core/src/config/ecal_config_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ namespace eCAL
return GetConfiguration().timesync;
}

Service::Configuration& GetServiceConfiguration()
{
return GetConfiguration().service;
}

Application::Configuration& GetApplicationConfiguration()
{
return GetConfiguration().application;
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/src/service/ecal_service_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace eCAL
// Register server
if (g_servicegate() != nullptr)
{
//g_servicegate()->Register(m_service_server_impl);
g_servicegate()->Register(service_name_, m_service_server_impl);
}
}

Expand All @@ -47,7 +47,7 @@ namespace eCAL
// Unregister server
if (g_servicegate() != nullptr)
{
//g_servicegate()->Unregister(m_service_server_impl->GetServiceName(), m_service_server_impl);
g_servicegate()->Unregister(m_service_server_impl->GetServiceName(), m_service_server_impl);
}

// Reset server implementation
Expand Down
Loading

0 comments on commit 3f9de03

Please sign in to comment.