Skip to content

Commit

Permalink
Merge branch 'master' into development/cyclicbuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
msieben authored Aug 15, 2024
2 parents 1c313c4 + d5443b2 commit c198470
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 3 deletions.
1 change: 1 addition & 0 deletions Source/Thunder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ endif()

target_link_libraries(${TARGET}
PRIVATE
CompileSettings::CompileSettings
CompileSettingsDebug::CompileSettingsDebug
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Cryptalgo::${NAMESPACE}Cryptalgo
Expand Down
83 changes: 83 additions & 0 deletions Source/Thunder/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1363,5 +1363,88 @@ namespace Plugin {
// also notify the JSON RPC listeners (if any)
Exchange::Controller::JLifeTime::Event::StateChange(*this, callsign, state, reason);
}

Core::hresult Controller::BuildInfo(IMetadata::Data::BuildInfo& buildInfo) const
{
#if defined(__WINDOWS__)
buildInfo.SystemType = IMetadata::Data::BuildInfo::SYSTEM_WINDOWS;
#elif defined(__LINUX__)
buildInfo.SystemType = IMetadata::Data::BuildInfo::SYSTEM_LINUX;
#elif defined(__APPLE__)
buildInfo.SystemType = IMetadata::Data::BuildInfo::SYSTEM_MACOS;
#else
#error No system type detected
#endif

#if defined(__DEBUG__)
#if defined(_THUNDER_DEBUG_OPTIMIZED_)
buildInfo.BuildType = IMetadata::Data::BuildInfo::DEBUG_OPTIMIZED;
#else
buildInfo.BuildType = IMetadata::Data::BuildInfo::DEBUG;
#endif
#else // !__DEBUG__
#if defined(_THUNDER_NDEBUG_DEB_INFO)
buildInfo.BuildType = IMetadata::Data::BuildInfo::RELEASE_WITH_DEBUG_INFO;
#elif defined(_THUNDER_PRODUCTION)
buildInfo.BuildType = IMetadata::Data::BuildInfo::PRODUCTION;
#else
buildInfo.BuildType = IMetadata::Data::BuildInfo::RELEASE;
#endif
#endif

#ifdef _TRACE_LEVEL
buildInfo.TraceLevel = _TRACE_LEVEL;
#endif

uint8_t extensions = 0;
#ifdef __CORE_WARNING_REPORTING__
extensions |= IMetadata::Data::BuildInfo::WARNING_REPORTING;
#endif
#ifdef __CORE_BLUETOOTH_SUPPORT__
extensions |= IMetadata::Data::BuildInfo::BLUETOOTH;
#endif
#ifdef HIBERNATE_SUPPORT_ENABLED
extensions |= IMetadata::Data::BuildInfo::HIBERNATE;
#endif
#ifdef PROCESSCONTAINERS_ENABLED
extensions |= IMetadata::Data::BuildInfo::PROCESS_CONTAINERS;
#endif

if (extensions != 0) {
buildInfo.Extensions = static_cast<IMetadata::Data::BuildInfo::extensiontype>(extensions);
}

#ifdef __CORE_MESSAGING__
buildInfo.Messaging = true;
#else
buildInfo.Messaging= false;
#endif

#ifdef __CORE_EXCEPTION_CATCHING__
buildInfo.ExceptionCatching = true;
#else
buildInfo.ExceptionCatching = false;
#endif

buildInfo.InstanceIDBits = (sizeof(Core::instance_id) * 8);

#ifdef __CORE_CRITICAL_SECTION_LOG__
buildInfo.DeadlockDetection = true;
#else
buildInfo.DeadlockDetection = false;
#endif

#ifdef __CORE_NO_WCHAR_SUPPORT__
buildInfo.WCharSupport = false;
#else
buildInfo.WCharSupport = true;
#endif

#ifdef THREADPOOL_COUNT
buildInfo.ThreadPoolCount = THREADPOOL_COUNT;
#endif

return (Core::ERROR_NONE);
}
}
}
1 change: 1 addition & 0 deletions Source/Thunder/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ namespace Plugin {
Core::hresult Threads(IMetadata::Data::IThreadsIterator*& threads) const override;
Core::hresult PendingRequests(IMetadata::Data::IPendingRequestsIterator*& requests) const override;
Core::hresult Version(IMetadata::Data::Version& version) const override;
Core::hresult BuildInfo(IMetadata::Data::BuildInfo& buildInfo) const override;

// IShells overrides
Core::hresult Register(Exchange::Controller::IShells::INotification* sink) override;
Expand Down
4 changes: 2 additions & 2 deletions Source/Thunder/PluginServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4184,7 +4184,7 @@ namespace PluginHost {
}
}
}
void Send(const Core::ProxyType<Web::Response>& response) override
void Send(const Core::ProxyType<Web::Response>& response VARIABLE_IS_NOT_USED) override
{
if (_requestClose == true) {
PluginHost::Channel::Close(0);
Expand All @@ -4209,7 +4209,7 @@ namespace PluginHost {

return (result);
}
void Send(const Core::ProxyType<Core::JSON::IElement>& element) override
void Send(const Core::ProxyType<Core::JSON::IElement>& element VARIABLE_IS_NOT_USED) override
{
TRACE(SocketFlow, (element));
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Thunder/Probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace Plugin {
}

// Notification of a Response send.
/* virtual */ void Probe::Listener::Send(const Core::ProxyType<Web::Response>& response)
/* virtual */ void Probe::Listener::Send(const Core::ProxyType<Web::Response>& response VARIABLE_IS_NOT_USED)
{
TRACE(Discovery, (response, _destinations.front()._destination));

Expand Down
39 changes: 39 additions & 0 deletions Source/plugins/IController.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,41 @@ namespace Controller {
uint8_t Patch /* @brief Patch number */;
};

struct BuildInfo {

enum systemtype : uint8_t {
SYSTEM_WINDOWS /* @text:Windows */,
SYSTEM_LINUX /* @text:Linux */,
SYSTEM_MACOS /* @text:MacOS */
};

enum buildtype : uint8_t {
DEBUG,
DEBUG_OPTIMIZED,
RELEASE_WITH_DEBUG_INFO,
RELEASE,
PRODUCTION
};

enum extensiontype : uint8_t {
WARNING_REPORTING = 1,
BLUETOOTH = 2,
HIBERBATE = 4,
PROCESS_CONTAINERS = 8
};

systemtype SystemType /* @brief System type */;
buildtype BuildType /* @brief Build type */;
Core::OptionalType<extensiontype> Extensions /* @bitmask */;
bool Messaging /* @brief Denotes whether Messaging is enabled*/;
bool ExceptionCatching /* @brief Denotes whether there is an exception */;
bool DeadlockDetection /* @brief Denotes whether deadlock detection is enabled */;
bool WCharSupport /* Denotes whether there is wchar support */;
uint8_t InstanceIDBits /* @brief Core instance bits */;
Core::OptionalType<uint8_t> TraceLevel /* @brief Trace level */;
uint8_t ThreadPoolCount /* Number of configured threads on the threadpool */;
};

struct CallStack {
Core::instance_id Address /* @brief Memory address */;
string Module /* @brief Module name */;
Expand Down Expand Up @@ -341,6 +376,10 @@ namespace Controller {
// @property
// @brief Thread callstack
virtual Core::hresult CallStack(const uint8_t thread /* @index */, Data::ICallStackIterator*& callstack /* @out */) const = 0;

// @property
// @brief Build information
virtual Core::hresult BuildInfo(Data::BuildInfo& buildInfo /* @out */) const = 0;
};

} // namespace Controller
Expand Down
2 changes: 2 additions & 0 deletions cmake/common/CompileSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")

elseif("${CMAKE_BUILD_TYPE}" STREQUAL "DebugOptimized")
target_compile_definitions(CompileSettings INTERFACE _THUNDER_DEBUG)
target_compile_definitions(CompileSettings INTERFACE _THUNDER_DEBUG_OPTIMIZED)
target_compile_definitions(CompileSettings INTERFACE _THUNDER_CALLSTACK_INFO)
target_compile_options(CompileSettings INTERFACE -funwind-tables)
set(CONFIG_DIR "DebugOptimized" CACHE STRING "Build config directory" FORCE)

elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
target_compile_definitions(CompileSettings INTERFACE _THUNDER_NDEBUG)
target_compile_definitions(CompileSettings INTERFACE _THUNDER_NDEBUG_DEB_INFO)
target_compile_definitions(CompileSettings INTERFACE _THUNDER_CALLSTACK_INFO)
target_compile_options(CompileSettings INTERFACE -funwind-tables)
set(CONFIG_DIR "RelWithDebInfo" CACHE STRING "Build config directory" FORCE)
Expand Down

0 comments on commit c198470

Please sign in to comment.