Skip to content

Commit

Permalink
Merge branch 'master' into development/Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
pwielders authored Oct 24, 2024
2 parents ac203d8 + d3a7a28 commit d076484
Show file tree
Hide file tree
Showing 9 changed files with 707 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Source/Thunder/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ namespace Plugin {
_parent.SubSystems();
}

string JobIdentifier() const {
return(_T("Thunder::Plugin::Controller::Sink::Job"));
}

private:
Controller& _parent;
};
Expand Down
20 changes: 18 additions & 2 deletions Source/Thunder/PluginServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2453,6 +2453,10 @@ namespace PluginHost {
return result;
}

string JobIdentifier() const {
return(_T("Thunder::PluginHost::Server::ServiceMap::CommunicatorServer"));
}

private:
ServiceMap& _parent;
const string _persistentPath;
Expand Down Expand Up @@ -2493,7 +2497,7 @@ namespace PluginHost {
_parent.Evaluate();
}
string JobIdentifier() const {
return(_T("PluginServer::SubSystems::Notification"));
return(_T("Thunder::PluginHost::Server::ServiceMap::SubSystems::Job"));
}

private:
Expand Down Expand Up @@ -2724,6 +2728,12 @@ namespace PluginHost {
POP_WARNING()
~ServiceMap()
{
Core::ProxyType<Core::IDispatch> job(_job.Revoke());

if (job.IsValid()) {
WorkerPool().Revoke(job);
_job.Revoked();
}
// Make sure all services are deactivated before we are killed (call Destroy on this object);
ASSERT(_services.size() == 0);
}
Expand Down Expand Up @@ -3447,6 +3457,11 @@ namespace PluginHost {
}

friend class Core::ThreadPool::JobType<ServiceMap&>;

string JobIdentifier() const {
return(_T("Thunder::PluginHost::Server::ServiceMap"));
}

void Dispatch()
{
_adminLock.Lock();
Expand Down Expand Up @@ -4543,8 +4558,9 @@ namespace PluginHost {
friend class Core::ThreadPool::JobType<ChannelMap&>;

string JobIdentifier() const {
return (_T("PluginServer::ChannelMap::Cleanup"));
return (_T("Thunder::PluginHost::Server::ChannelMap"));
}

void Dispatch()
{
TRACE(Activity, (string(_T("Cleanup job running..\n"))));
Expand Down
4 changes: 4 additions & 0 deletions Source/ThunderPlugin/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ POP_WARNING()
}
}

string JobIdentifier() const {
return(_T("Thunder::Process::WorkerPoolImplmenetation::Sink"));
}

private:
WorkerPoolImplementation& _parent;
Core::ThreadPool::JobType<Sink&> _job;
Expand Down
13 changes: 7 additions & 6 deletions Source/core/TypeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "Portability.h"
#include <functional>
#include <type_traits>

namespace Thunder {

Expand Down Expand Up @@ -191,14 +192,14 @@ namespace Core {
// Args: arguments that func should have, note it will also work if overrides of Func are available on T. Note: passing Args&&... itself is also allowed here to allow for variable parameters
#define IS_MEMBER_AVAILABLE_INHERITANCE_TREE(func, name) \
template <bool, typename TT> \
struct name##_IsMemberAvailableCheck : public TT { \
using type = TT; \
struct name##_IsMemberAvailableCheck : public std::remove_reference<TT>::type { \
using type = typename std::remove_reference<TT>::type; \
template <typename TTT, typename... Args2> \
auto Verify() -> decltype( (TTT::func(std::declval<Args2>()...))); \
}; \
template <typename TT> \
struct name##_IsMemberAvailableCheck<true, TT> : public TT { \
using type = const TT; \
struct name##_IsMemberAvailableCheck<true, TT> : public std::remove_reference<TT>::type { \
using type = const typename std::remove_reference<TT>::type; \
template <typename TTT, typename... Args2> \
auto Verify() const -> decltype( (TTT::func(std::declval<Args2>()...))); \
}; \
Expand All @@ -207,12 +208,12 @@ namespace Core {
typedef char yes[1]; \
typedef char no[2]; \
template <typename U, \
typename RR = decltype(std::declval<name##_IsMemberAvailableCheck<std::is_const<U>::value, U>>().template Verify<U, Args...>()), \
typename RR = decltype(std::declval<name##_IsMemberAvailableCheck<std::is_const<typename std::remove_reference<U>::type>::value, U>>().template Verify<U, Args...>()), \
typename Z = typename std::enable_if<std::is_same<R, RR>::value>::type> \
static yes& chk(int); \
template <typename U> \
static no& chk(...); \
static bool const value = sizeof(chk<T>(0)) == sizeof(yes); \
static bool const value = sizeof(chk<typename std::remove_reference<T>::type>(0)) == sizeof(yes); \
}


Expand Down
4 changes: 4 additions & 0 deletions Source/extensions/bluetooth/audio/AVDTPSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ namespace AVDTP {
}
~Socket() = default;

string JobIdentifier() const {
return(_T("Thunder::Bluetooth::AVDTP::Socket"));
}

public:
uint16_t OutputMTU() const {
return (_omtu);
Expand Down
4 changes: 4 additions & 0 deletions Source/plugins/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ POP_WARNING()
_parent.Register();
}

string JobIdentifier() const {
return(_T("Thunder::RPC::PluginSmartInterfaceType::RegisterJob"));
}

private:
PluginSmartInterfaceType& _parent;
};
Expand Down
5 changes: 5 additions & 0 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ option(WORKERPOOL_TEST "WorkerPool stress test" OFF)
option(FILE_UNLINK_TEST "File unlink test" OFF)
option(REDIRECT_TEST "Test stream redirection" OFF)
option(MESSAGEBUFFER_TEST "Test message buffer" OFF)
option(UNRAVELLER "reveal thread details" OFF)

if(BUILD_TESTS)
add_subdirectory(unit)
Expand Down Expand Up @@ -36,3 +37,7 @@ endif()
if(CYCLICBUFFER_TEST)
add_subdirectory(cyclic-buffer)
endif()

if(UNRAVELLER)
add_subdirectory(unraveller)
endif()
31 changes: 31 additions & 0 deletions Tests/unraveller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# If not stated otherwise in this file or this component's license file the
# following copyright and licenses apply:
#
# Copyright 2024 Metrological
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_executable(unraveller main.cpp)

target_link_libraries(unraveller
PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Cryptalgo::${NAMESPACE}Cryptalgo
)

set_target_properties(unraveller PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
)

install(TARGETS unraveller DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Test)
Loading

0 comments on commit d076484

Please sign in to comment.