Skip to content

Commit

Permalink
Merge branch 'master' into feature/redesign-subscriber-api
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Dec 17, 2024
2 parents 99c4b20 + b74392d commit 213236b
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 558 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Checks: "-*,
misc-*,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-include-cleaner,
modernize-*,
-modernize-pass-by-value,
Expand All @@ -61,6 +62,7 @@ Checks: "-*,
-readability-redundant-access-specifiers,
-readability-uppercase-literal-suffix,
-readability-use-anyofallof,
-readability-avoid-const-params-in-decls,
"
WarningsAsErrors: ''
HeaderFilterRegex: '^((?!/thirdparty/|/_deps/).)*$'
Expand Down
4 changes: 1 addition & 3 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,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
8 changes: 4 additions & 4 deletions ecal/core/src/cimpl/ecal_monitoring_cimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ extern "C"
{
ECALC_API int eCAL_Monitoring_SetExclFilter(const char* filter_)
{
return(eCAL::Monitoring::SetExclFilter(std::string(filter_)));
return(static_cast<int>(!eCAL::Monitoring::SetExclFilter(std::string(filter_))));
}

ECALC_API int eCAL_Monitoring_SetInclFilter(const char* filter_)
{
return(eCAL::Monitoring::SetInclFilter(std::string(filter_)));
return(static_cast<int>(!eCAL::Monitoring::SetInclFilter(std::string(filter_))));
}

ECALC_API int eCAL_Monitoring_SetFilterState(int state_)
{
return(eCAL::Monitoring::SetFilterState(state_ != 0));
return(static_cast<int>(!eCAL::Monitoring::SetFilterState(state_ != 0)));
}

ECALC_API int eCAL_Monitoring_GetMonitoring(void* buf_, int buf_len_)
{
std::string buf;
if (eCAL::Monitoring::GetMonitoring(buf) != 0)
if (eCAL::Monitoring::GetMonitoring(buf))
{
return(CopyBuffer(buf_, buf_len_, buf));
}
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
Loading

0 comments on commit 213236b

Please sign in to comment.