Skip to content

Commit

Permalink
[core] Removed AddRegistrationCallback API and its underlying code ba…
Browse files Browse the repository at this point in the history
…se (#1861)
  • Loading branch information
hannemn authored Dec 16, 2024
1 parent 7039426 commit 50f5b81
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 442 deletions.
4 changes: 1 addition & 3 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,7 @@ if (ECAL_CORE_REGISTRATION)
src/registration/ecal_registration_sample_applier.cpp
src/registration/ecal_registration_sample_applier.h
src/registration/ecal_registration_sample_applier_gates.cpp
src/registration/ecal_registration_sample_applier_gates.h
src/registration/ecal_registration_sample_applier_user.cpp
src/registration/ecal_registration_sample_applier_user.h
src/registration/ecal_registration_sample_applier_gates.h
src/registration/ecal_registration_timeout_provider.cpp
src/registration/ecal_registration_timeout_provider.h
src/registration/ecal_registration_sender.h
Expand Down
13 changes: 0 additions & 13 deletions ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ enum eCAL_Server_Event
server_event_disconnected = 2,
};

/**
* @brief eCAL common registration event type.
**/
enum eCAL_Registration_Event
{
reg_event_none = 0,
reg_event_publisher = 1,
reg_event_subscriber = 2,
reg_event_service = 3,
reg_event_client = 5,
reg_event_process = 4,
};

#ifdef _MSC_VER
#pragma pack(push, 8)
#endif
Expand Down
8 changes: 0 additions & 8 deletions ecal/core/include/ecal/ecal_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,6 @@ namespace eCAL
**/
using TimerCallbackT = std::function<void ()>;

/**
* @brief Registration callback type.
*
* @param sample_ The sample protocol buffer registration payload buffer.
* @param sample_size_ The payload buffer size.
**/
using RegistrationCallbackT = std::function<void (const char* sample_, int sample_size_)>;

/**
* @brief Publisher event callback function type. (deprecated)
*
Expand Down
19 changes: 0 additions & 19 deletions ecal/core/include/ecal/ecal_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,6 @@ namespace eCAL
**/
ECAL_API void SetState(eCAL_Process_eSeverity severity_, eCAL_Process_eSeverity_Level level_, const char* info_);

/**
* @brief Add registration callback.
*
* @param event_ The type of registration.
* @param callback_ The callback.
*
* @return Zero if succeeded.
**/
ECAL_API int AddRegistrationCallback(enum eCAL_Registration_Event event_, const RegistrationCallbackT& callback_);

/**
* @brief Remove registration callback.
*
* @param event_ The type of registration.
*
* @return Zero if succeeded.
**/
ECAL_API int RemRegistrationCallback(enum eCAL_Registration_Event event_);

/**
* @brief Start specified process (windows only).
*
Expand Down
18 changes: 0 additions & 18 deletions ecal/core/src/ecal_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,24 +298,6 @@ namespace eCAL
g_process_info = info_;
}
}

int AddRegistrationCallback(enum eCAL_Registration_Event event_, const RegistrationCallbackT& callback_)
{
#if ECAL_CORE_REGISTRATION
if (g_registration_receiver() == nullptr) return -1;
if (g_registration_receiver()->AddRegistrationCallback(event_, callback_)) return 0;
#endif
return -1;
}

int RemRegistrationCallback(enum eCAL_Registration_Event event_)
{
#if ECAL_CORE_REGISTRATION
if (g_registration_receiver() == nullptr) return -1;
if (g_registration_receiver()->RemRegistrationCallback(event_)) return 0;
#endif
return -1;
}
}
}

Expand Down
15 changes: 0 additions & 15 deletions ecal/core/src/registration/ecal_registration_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ namespace eCAL
{
Registration::CSampleApplierGates::ApplySample(sample_);
});
m_sample_applier.SetCustomApplySampleCallback("custom_registration", [this](const eCAL::Registration::Sample& sample_)
{
m_user_applier.ApplySample(sample_);
});

}

CRegistrationReceiver::~CRegistrationReceiver()
Expand Down Expand Up @@ -138,16 +133,6 @@ namespace eCAL
m_created = false;
}

bool CRegistrationReceiver::AddRegistrationCallback(enum eCAL_Registration_Event event_, const RegistrationCallbackT& callback_)
{
return m_user_applier.AddRegistrationCallback(event_, callback_);
}

bool CRegistrationReceiver::RemRegistrationCallback(enum eCAL_Registration_Event event_)
{
return m_user_applier.RemRegistrationCallback(event_);
}

void CRegistrationReceiver::SetCustomApplySampleCallback(const std::string& customer_, const ApplySampleCallbackT& callback_)
{
m_sample_applier.SetCustomApplySampleCallback(customer_, callback_);
Expand Down
9 changes: 0 additions & 9 deletions ecal/core/src/registration/ecal_registration_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "serialization/ecal_struct_sample_registration.h"
#include "registration/ecal_registration_sample_applier.h"
#include "registration/ecal_registration_sample_applier_gates.h"
#include "registration/ecal_registration_sample_applier_user.h"
#include "config/attributes/registration_attributes.h"

#include <atomic>
Expand Down Expand Up @@ -67,9 +66,6 @@ namespace eCAL
void Start();
void Stop();

bool AddRegistrationCallback(enum eCAL_Registration_Event event_, const RegistrationCallbackT& callback_);
bool RemRegistrationCallback(enum eCAL_Registration_Event event_);

using ApplySampleCallbackT = std::function<void(const Registration::Sample&)>;
void SetCustomApplySampleCallback(const std::string& customer_, const ApplySampleCallbackT& callback_);
void RemCustomApplySampleCallback(const std::string& customer_);
Expand All @@ -90,11 +86,6 @@ namespace eCAL
// This class distributes samples to all everyone who is interested in being notified about samples
Registration::CSampleApplier m_sample_applier;

// These classes are interested in being notified about samples
// Possibly remove these from this class
// The custom user callbacks (who receive serialized samples), e.g. registration events.
Registration::CSampleApplierUser m_user_applier;

Registration::SAttributes m_attributes;
};
}
120 changes: 0 additions & 120 deletions ecal/core/src/registration/ecal_registration_sample_applier_user.cpp

This file was deleted.

57 changes: 0 additions & 57 deletions ecal/core/src/registration/ecal_registration_sample_applier_user.h

This file was deleted.

1 change: 0 additions & 1 deletion ecal/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ if(ECAL_CORE_MONITORING)
add_subdirectory(cpp/monitoring/monitoring_performance)
if(ECAL_CORE_HAS_PROTOBUF)
add_subdirectory(cpp/monitoring/monitoring_rec)
add_subdirectory(cpp/monitoring/monitoring_reg)
endif()
endif()

Expand Down
44 changes: 0 additions & 44 deletions ecal/samples/cpp/monitoring/monitoring_reg/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 50f5b81

Please sign in to comment.