Skip to content

Commit

Permalink
[core] rearrange service and pubsub headers into folders. (#1934)
Browse files Browse the repository at this point in the history
  • Loading branch information
KerstinKeller authored Jan 23, 2025
1 parent 43de92f commit 1aff2bb
Show file tree
Hide file tree
Showing 58 changed files with 408 additions and 368 deletions.
5 changes: 2 additions & 3 deletions app/rec/rec_client_core/src/ecal_rec_impl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
* Copyright (C) 2016 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,8 +40,7 @@

#include "frame_buffer.h"

#include <ecal/ecal_callback.h>
#include <ecal/ecal_subscriber.h>
#include <ecal/pubsub/subscriber.h>

namespace eCAL
{
Expand Down
4 changes: 2 additions & 2 deletions app/rec/rec_client_core/src/frame.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
#include <string>
#include <chrono>
#include <ecal/ecal_time.h>
#include <ecal/ecal_callback.h>
#include <ecal/pubsub/types.h>

namespace eCAL
{
Expand Down
2 changes: 1 addition & 1 deletion app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <condition_variable>

#include <ecal/ecal.h>
#include <ecal/ecal_client.h>
#include <ecal/service/client.h>
#include <ecal_utils/string.h>
#include <rec_server_core/rec_server.h>
#include <rec_client_core/ecal_rec_defs.h>
Expand Down
4 changes: 2 additions & 2 deletions app/sys/sys_cli/src/commands/command.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2020 Continental Corporation
* Copyright (C) 2016 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,7 @@
#include <memory>
#include <ecalsys/ecal_sys.h>

#include <ecal/ecal_client.h>
#include <ecal/service/client.h>

#ifdef _MSC_VER
#pragma warning(push)
Expand Down
4 changes: 2 additions & 2 deletions app/sys/sys_cli/src/commands/helpers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2020 Continental Corporation
* Copyright (C) 2016 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,7 @@
#include <memory>
#include <ecalsys/ecal_sys.h>

#include <ecal/ecal_client.h>
#include <ecal/service/client.h>

#ifdef _MSC_VER
#pragma warning(push)
Expand Down
2 changes: 1 addition & 1 deletion app/sys/sys_cli/src/ecalsys_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <thread>

#include <ecal/ecal.h>
#include <ecal/ecal_client.h>
#include <ecal/service/client.h>
#include <ecalsys/ecal_sys.h>
#include <ecalsys/esys_defs.h>

Expand Down
15 changes: 8 additions & 7 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,19 @@ set(ecal_header_cmn
include/ecal/config/subscriber.h
include/ecal/config/time.h
include/ecal/config/transport_layer.h
include/ecal/pubsub/subscriber.h
include/ecal/pubsub/types.h
include/ecal/pubsub/payload_writer.h
include/ecal/pubsub/publisher.h
include/ecal/service/client.h
include/ecal/service/client_instance.h
include/ecal/service/server.h
include/ecal/service/types.h
include/ecal/types/logging.h
include/ecal/types/monitoring.h
include/ecal/ecal.h
include/ecal/ecal_callback.h
include/ecal/v5/ecal_callback.h
include/ecal/ecal_client.h
include/ecal/ecal_client_instance.h
include/ecal/v5/ecal_client.h
include/ecal/ecal_config.h
include/ecal/ecal_core.h
Expand All @@ -545,18 +551,13 @@ set(ecal_header_cmn
include/ecal/ecal_log.h
include/ecal/ecal_log_level.h
include/ecal/ecal_os.h
include/ecal/ecal_payload_writer.h
include/ecal/ecal_monitoring.h
include/ecal/ecal_namespace.h
include/ecal/ecal_process.h
include/ecal/ecal_process_severity.h
include/ecal/ecal_registration.h
include/ecal/ecal_publisher.h
include/ecal/v5/ecal_publisher.h
include/ecal/ecal_server.h
include/ecal/v5/ecal_server.h
include/ecal/ecal_service_info.h
include/ecal/ecal_subscriber.h
include/ecal/v5/ecal_subscriber.h
include/ecal/ecal_time.h
include/ecal/ecal_timer.h
Expand Down
14 changes: 8 additions & 6 deletions ecal/core/include/ecal/ecal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
* Copyright (C) 2016 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,19 +28,21 @@
#include <ecal/ecal_os.h>
#include <ecal/ecal_defs.h>
#include <ecal/ecal_callback.h>
#include <ecal/ecal_client.h>
#include <ecal/service/client.h>
#include <ecal/ecal_config.h>
#include <ecal/ecal_core.h>
#include <ecal/ecal_log.h>
#include <ecal/ecal_process.h>
#include <ecal/ecal_monitoring.h>
#include <ecal/ecal_publisher.h>
#include <ecal/ecal_registration.h>
#include <ecal/ecal_server.h>
#include <ecal/ecal_service_info.h>
#include <ecal/ecal_subscriber.h>
#include <ecal/service/server.h>
#include <ecal/service/types.h>
#include <ecal/ecal_time.h>
#include <ecal/ecal_timer.h>
#include <ecal/ecal_tlayer.h>
#include <ecal/ecal_util.h>
#include <ecal/config/configuration.h>
#include <ecal/pubsub/publisher.h>
#include <ecal/pubsub/subscriber.h>
#include <ecal/service/client.h>
#include <ecal/service/server.h>
180 changes: 0 additions & 180 deletions ecal/core/include/ecal/ecal_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,192 +25,12 @@
#pragma once

#include <ecal/ecal_deprecate.h>
#include <ecal/ecal_namespace.h>
#include <ecal/ecal_types.h>

#include <functional>
#include <string>

namespace eCAL
{
/**
* @brief eCAL subscriber receive callback struct.
**/
struct SReceiveCallbackData
{
void* buf = nullptr; //!< payload buffer
long size = 0; //!< payload buffer size
long long id = 0; //!< publisher id (SetId())
long long time = 0; //!< publisher send time in µs
long long clock = 0; //!< publisher send clock
};

/**
* @brief eCAL subscriber event callback type.
**/
enum class eSubscriberEvent
{
none = 0,
connected = 1,
disconnected = 2,
dropped = 3
};

inline std::string to_string(eSubscriberEvent event_) {
switch (event_) {
case eSubscriberEvent::none: return "NONE";
case eSubscriberEvent::connected: return "CONNECTED";
case eSubscriberEvent::disconnected: return "DISCONNECTED";
case eSubscriberEvent::dropped : return "DROPPED";
default: return "Unknown";
}
}

/**
* @brief eCAL publisher event callback type.
**/
enum class ePublisherEvent
{
none = 0,
connected = 1,
disconnected = 2,
dropped = 3
};

inline std::string to_string(ePublisherEvent event_) {
switch (event_) {
case ePublisherEvent::none: return "NONE";
case ePublisherEvent::connected: return "CONNECTED";
case ePublisherEvent::disconnected: return "DISCONNECTED";
case ePublisherEvent::dropped: return "DROPPED";
default: return "Unknown";
}
}

/**
* @brief eCAL service client event callback type.
**/
enum class eClientEvent
{
none = 0,
connected = 1,
disconnected = 2,
timeout = 3,
};

inline std::string to_string(eClientEvent event_) {
switch (event_) {
case eClientEvent::none: return "NONE";
case eClientEvent::connected: return "CONNECTED";
case eClientEvent::disconnected: return "DISCONNECTED";
default: return "Unknown";
}
}

/**
* @brief eCAL service server event callback type.
**/
enum class eServerEvent
{
none = 0,
connected = 1,
disconnected = 2,
};

inline std::string to_string(eServerEvent event_) {
switch (event_) {
case eServerEvent::none: return "NONE";
case eServerEvent::connected: return "CONNECTED";
case eServerEvent::disconnected: return "DISCONNECTED";
default: return "Unknown";
}
}

/**
* @brief Timer callback function type.
**/
using TimerCallbackT = std::function<void()>;

ECAL_CORE_NAMESPACE_V6
{
/**
* @brief Receive callback function type with topic id and data struct. The topic id contains the topic name, the process
* name, the host name and a uniques topic identifier.
*
* @param topic_id_ The topic id struct of the received message.
* @param data_type_info_ Topic data type information (encoding, type, descriptor).
* @param data_ Data struct containing payload, timestamp and publication clock.
**/
using ReceiveCallbackT = std::function<void(const Registration::STopicId& topic_id_, const SDataTypeInformation& data_type_info_, const SReceiveCallbackData& data_)>;

/**
* @brief eCAL publisher event callback struct.
**/
struct SPubEventCallbackData
{
ePublisherEvent event_type{ ePublisherEvent::none }; //!< publisher event type
long long event_time{ 0 }; //!< publisher event time in µs (eCAL time)
SDataTypeInformation subscriber_datatype; //!< datatype description of the connected subscriber
};

/**
* @brief Publisher event callback function type.
*
* @param topic_id_ The topic id struct of the received message.
* @param data_ Event callback data structure with the event specific information.
**/
using PubEventCallbackT = std::function<void(const Registration::STopicId& topic_id_, const SPubEventCallbackData& data_)>;

/**
* @brief eCAL subscriber event callback struct.
**/
struct SSubEventCallbackData
{
eSubscriberEvent event_type{ eSubscriberEvent::none }; //!< subscriber event type
long long event_time{ 0 }; //!< subscriber event time in µs (eCAL time)
SDataTypeInformation publisher_datatype; //!< topic information of the connected publisher
};

/**
* @brief Subscriber event callback function type.
*
* @param topic_id_ The topic id struct of the received message.
* @param data_ Event callback data structure with the event specific information.
**/
using SubEventCallbackT = std::function<void(const Registration::STopicId& topic_id_, const SSubEventCallbackData& data_)>;

/**
* @brief eCAL client event callback struct.
**/
struct SClientEventCallbackData
{
eClientEvent type{ eClientEvent::none }; //!< event type
long long time = 0; //!< event time in µs
};

/**
* @brief Client event callback function type.
*
* @param service_id_ The service id struct of the connection that triggered the event.
* @param data_ Event callback data structure with the event specific information.
**/
using ClientEventCallbackT = std::function<void(const Registration::SServiceId& service_id_, const SClientEventCallbackData& data_)>;

/**
* @brief eCAL server event callback struct.
**/
struct SServerEventCallbackData
{
eServerEvent type{ eServerEvent::none }; //!< event type
long long time = 0; //!< event time in µs
};

/**
* @brief Server event callback function type.
*
* @param service_id_ The service id struct of the connection that triggered the event.
* @param data_ Event callback data structure with the event specific information.
**/
using ServerEventCallbackT = std::function<void(const Registration::SServiceId& service_id_, const struct SServerEventCallbackData& data_)>;
}
}
1 change: 0 additions & 1 deletion ecal/core/include/ecal/ecal_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <ecal/ecal_os.h>
#include <ecal/ecal_process_mode.h>
#include <ecal/ecal_process_severity.h>
#include <ecal/ecal_callback.h>

namespace eCAL
{
Expand Down
3 changes: 2 additions & 1 deletion ecal/core/include/ecal/ecal_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
#pragma once

#include <ecal/ecal_os.h>
#include <ecal/ecal_types.h>
#include <ecal/pubsub/types.h>
#include <ecal/service/types.h>

#include <cstdint>
#include <functional>
Expand Down
Loading

0 comments on commit 1aff2bb

Please sign in to comment.