Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ endif()

if(PLUGINS)
add_subdirectory(plugins)
add_subdirectory(common)
endif()

if(PROCESS)
Expand Down
44 changes: 43 additions & 1 deletion Source/Thunder.sln

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Source/Thunder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ target_link_libraries(${TARGET}
${NAMESPACE}Messaging::${NAMESPACE}Messaging
${NAMESPACE}WebSocket::${NAMESPACE}WebSocket
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${NAMESPACE}Common::${NAMESPACE}Common
${NAMESPACE}COMProcess::${NAMESPACE}COMProcess # For COM executable define
Threads::Threads
)
Expand Down
1 change: 1 addition & 0 deletions Source/Thunder/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <core/core.h>
#include <cryptalgo/cryptalgo.h>
#include <plugins/plugins.h>
#include <common/common.h>
#include <websocket/websocket.h>
#include <messaging/messaging.h>

Expand Down
1 change: 1 addition & 0 deletions Source/ThunderPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ target_link_libraries(${TARGET}
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Messaging::${NAMESPACE}Messaging
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${NAMESPACE}Common::${NAMESPACE}Common
${NAMESPACE}WebSocket::${NAMESPACE}WebSocket
${NAMESPACE}COM::${NAMESPACE}COM
)
Expand Down
1 change: 1 addition & 0 deletions Source/ThunderPlugin/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
#include <core/core.h>
#include <com/com.h>
#include <plugins/plugins.h>
#include <common/common.h>
91 changes: 91 additions & 0 deletions Source/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
set(TARGET ${NAMESPACE}Common)

add_library(${TARGET}
Channel.cpp
JSONRPC.cpp
Metadata.cpp
Module.cpp
Service.cpp
Shell.cpp
StateControl.cpp
SubSystem.cpp
VirtualInput.cpp
System.cpp
)

set(PUBLIC_HEADERS
Channel.h
common.h
Config.h
Configuration.h
JSONRPC.h
Metadata.h
Request.h
Service.h
StateControl.h
SubSystem.h
System.h
Types.h
VirtualInput.h
Module.h
)

target_link_libraries(${TARGET}
PUBLIC
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Cryptalgo::${NAMESPACE}Cryptalgo
${NAMESPACE}Messaging::${NAMESPACE}Messaging
${NAMESPACE}COM::${NAMESPACE}COM
${NAMESPACE}WebSocket::${NAMESPACE}WebSocket
PRIVATE
CompileSettingsDebug::CompileSettingsDebug
)

if (WARNING_REPORTING)
target_link_libraries(${TARGET}
PUBLIC
${NAMESPACE}WarningReporting::${NAMESPACE}WarningReporting
)
endif()

target_include_directories(${TARGET}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../plugins>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/plugins>
)

target_compile_definitions(${TARGET} PRIVATE COMMON_EXPORTS)

set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD ${CXX_STD}
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}"
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${VERSION}
)
endif()

install(
TARGETS ${TARGET} EXPORT ${TARGET}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${NAMESPACE}_Development
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${NAMESPACE}_Runtime NAMELINK_COMPONENT ${NAMESPACE}_Development
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime
FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/common COMPONENT ${NAMESPACE}_Development
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}
)

InstallPackageConfig(
TARGETS ${TARGET}
DESCRIPTION "Basic library with common plugin host implementation support.")

InstallCMakeConfig(TARGETS ${TARGET})
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

#include "Module.h"
#include "Config.h"
#include "IPlugin.h"
#include "IShell.h"
#include "ISubSystem.h"
#include "IController.h"
#include <plugins/IPlugin.h>
#include <plugins/IShell.h>
#include <plugins/ISubSystem.h>
#include <plugins/IController.h>

namespace Thunder {
namespace Plugin {
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions Source/plugins/JSONRPC.h → Source/common/JSONRPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

#include "Module.h"
#include "System.h"
#include "IShell.h"
#include "IPlugin.h"
#include "IDispatcher.h"
#include <plugins/IShell.h>
#include <plugins/IPlugin.h>
#include <plugins/IDispatcher.h>

namespace Thunder {

Expand Down Expand Up @@ -1975,4 +1975,3 @@ namespace PluginHost {

} // namespace Thunder::PluginHost
}

4 changes: 2 additions & 2 deletions Source/plugins/Metadata.cpp → Source/common/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include "Module.h"
#include "Metadata.h"
#include "IStateControl.h"
#include "ISubSystem.h"
#include <plugins/IStateControl.h>
#include <plugins/ISubSystem.h>

namespace Thunder {

Expand Down
2 changes: 1 addition & 1 deletion Source/plugins/Metadata.h → Source/common/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "Module.h"
#include "Configuration.h"

#include "IController.h"
#include <plugins/IController.h>
#include <plugins/json/JsonData_Metadata.h>
#include <plugins/json/JsonData_Discovery.h>

Expand Down
27 changes: 27 additions & 0 deletions Source/common/Module.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 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.
*/

#include "Module.h"
#include <plugins/IController.h>

#ifdef BUILD_SHARED_LIBS
MODULE_NAME_DECLARATION(BUILD_REFERENCE)
#else
MODULE_NAME_ARCHIVE_DECLARATION
#endif
41 changes: 41 additions & 0 deletions Source/common/Module.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 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.
*/

#pragma once

#ifndef MODULE_NAME
#define MODULE_NAME Common
#endif

#include <core/core.h>
#include <com/com.h>
#include <cryptalgo/cryptalgo.h>
#include <websocket/websocket.h>
#include <messaging/messaging.h>

#ifdef __CORE_WARNING_REPORTING__
#include <warningreporting/warningreporting.h>
#endif

#if defined(__WINDOWS__) && defined(COMMON_EXPORTS)
#undef EXTERNAL
#define EXTERNAL EXTERNAL_EXPORT
#endif

// @insert <com/Ids.h>
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Source/plugins/Service.h → Source/common/Service.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include "Configuration.h"
#include "Metadata.h"
#include "System.h"
#include "IPlugin.h"
#include "IShell.h"
#include <plugins/IPlugin.h>
#include <plugins/IShell.h>

namespace Thunder {
namespace PluginHost {
Expand Down
2 changes: 1 addition & 1 deletion Source/plugins/Shell.cpp → Source/common/Shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include "Module.h"
#include "IShell.h"
#include <plugins/IShell.h>
#include "Configuration.h"

namespace Thunder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include "Module.h"
#include "IStateControl.h"
#include <plugins/IStateControl.h>

namespace Thunder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#pragma once

#include "Module.h"
#include "IStateControl.h"
#include <plugins/IStateControl.h>

namespace Thunder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include "Module.h"
#include "ISubSystem.h"
#include <plugins/ISubSystem.h>

namespace Thunder {

Expand Down
2 changes: 1 addition & 1 deletion Source/plugins/SubSystem.h → Source/common/SubSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#pragma once

#include "Module.h"
#include "ISubSystem.h"
#include <plugins/ISubSystem.h>

namespace Thunder {

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Source/plugins/Types.h → Source/common/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include "Module.h"

#include "IPlugin.h"
#include "IShell.h"
#include <plugins/IPlugin.h>
#include <plugins/IShell.h>

namespace Thunder {
namespace PluginHost {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define __VIRTUAL_INPUT__

#include "Module.h"
#include "IVirtualInput.h"
#include <plugins/IVirtualInput.h>

namespace Thunder {
namespace PluginHost {
Expand Down
49 changes: 49 additions & 0 deletions Source/common/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2026 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.
*/

#pragma once

#ifdef __WINDOWS__
#pragma comment(lib, "common.lib")
#endif

#ifndef MODULE_NAME
#error "Please define a MODULE_NAME that describes the binary/library you are building."
#endif

// Since this header is included, the code using it is external to Thunder core.
// So therefore it should use the correct Tracing functionality and not TRACE_L# (which are just fancy printfs).
#define CORE_TRACE_NOT_ALLOWED

#include "Module.h"
#include "Config.h"
#include "Channel.h"
#include "Configuration.h"
Comment thread
nxtum marked this conversation as resolved.
#include "JSONRPC.h"
#include "Metadata.h"
#include "Request.h"
#include "Service.h"
#include "StateControl.h"
#include "SubSystem.h"
#include "System.h"
#include "Types.h"
#include "VirtualInput.h"

WPEFRAMEWORK_NESTEDNAMESPACE_COMPATIBILIY(Plugin)
WPEFRAMEWORK_NESTEDNAMESPACE_COMPATIBILIY(PluginHost)
Loading
Loading