Added test case and setting Test configuration
This commit is contained in:
1 parent
f815271486
commit
a86f9b5bac
48 files changed
+423
-168
No files matched your search
@@ -12,6 +12,7 @@
|
||||
#include <dds/topic/find.hpp>
|
||||
#include <rti/core/xtypes/DynamicDataImpl.hpp>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
namespace DDSGeneric
|
||||
{
|
||||
@@ -309,6 +310,19 @@ class DynamicDataReader final
|
||||
callbackFunc(sample.data(), topicName, sample.info());
|
||||
}
|
||||
|
||||
template<typename C>
|
||||
static bool isValid(const C& callbackFunc)
|
||||
{
|
||||
// Generic version for any type - checks if callable/non-null
|
||||
// Use simple pointer check for function pointers, true for other types
|
||||
if constexpr (std::is_pointer_v<C>)
|
||||
return callbackFunc != nullptr;
|
||||
else if constexpr (std::is_function_v<std::remove_pointer_t<C>>)
|
||||
return callbackFunc != nullptr;
|
||||
else
|
||||
return true; // Assume valid for functor objects, std::function, etc.
|
||||
}
|
||||
|
||||
static bool isValid(const SubscriberCallback& callbackFunc)
|
||||
{
|
||||
return callbackFunc != nullptr;
|
||||
|
||||
Reference in new issue
Block a user