├── .gitignore
├── .vscode
├── launch.json
└── settings.json
├── 3FD.sln
├── 3fd
├── broker
│ ├── 3fd-broker.vcxproj
│ ├── 3fd-broker.vcxproj.filters
│ ├── CMakeLists.txt
│ ├── broker.h
│ ├── broker_impl.cpp
│ ├── broker_impl.h
│ ├── broker_impl_reader.cpp
│ ├── broker_impl_writer.cpp
│ ├── pch.cpp
│ └── pch.h
├── core
│ ├── 3fd-config-template.xml
│ ├── 3fd-core-winrt.vcxproj
│ ├── 3fd-core-winrt.vcxproj.filters
│ ├── 3fd-core.vcxproj
│ ├── 3fd-core.vcxproj.filters
│ ├── CMakeLists.txt
│ ├── callstacktracer.cpp
│ ├── callstacktracer.h
│ ├── configuration.cpp
│ ├── configuration.h
│ ├── dependencies.cpp
│ ├── dependencies.h
│ ├── exceptions.cpp
│ ├── exceptions.h
│ ├── gc.h
│ ├── gc_addresseshashtable.cpp
│ ├── gc_addresseshashtable.h
│ ├── gc_arrayofedges.cpp
│ ├── gc_arrayofedges.h
│ ├── gc_common.h
│ ├── gc_garbagecollector.cpp
│ ├── gc_memaddress.h
│ ├── gc_memorydigraph.cpp
│ ├── gc_memorydigraph.h
│ ├── gc_messages.cpp
│ ├── gc_messages.h
│ ├── gc_vertex.cpp
│ ├── gc_vertex.h
│ ├── gc_vertexstore.cpp
│ ├── gc_vertexstore.h
│ ├── logger.cpp
│ ├── logger.h
│ ├── logger_console.cpp
│ ├── logger_dsa.cpp
│ ├── logger_winrt.cpp
│ ├── pch.cpp
│ ├── pch.h
│ ├── preprocessing.h
│ ├── runtime.cpp
│ ├── runtime.h
│ ├── sptr.h
│ └── targetver.h
├── isam
│ ├── 3fd-isam-winrt.vcxproj
│ ├── 3fd-isam-winrt.vcxproj.filters
│ ├── 3fd-isam.vcxproj
│ ├── 3fd-isam.vcxproj.filters
│ ├── isam.h
│ ├── isam_impl.cpp
│ ├── isam_impl.h
│ ├── isam_impl_cursor.cpp
│ ├── isam_impl_database.cpp
│ ├── isam_impl_databaseconn.cpp
│ ├── isam_impl_errorhelper.cpp
│ ├── isam_impl_instance.cpp
│ ├── isam_impl_recordreader.cpp
│ ├── isam_impl_session.cpp
│ ├── isam_impl_table.cpp
│ ├── isam_impl_tablewriter.cpp
│ ├── isam_impl_transaction.cpp
│ ├── pch.cpp
│ ├── pch.h
│ └── targetver.h
├── opencl
│ ├── 3fd-opencl.vcxproj
│ ├── 3fd-opencl.vcxproj.filters
│ ├── CL
│ │ ├── LICENSE
│ │ ├── cl.h
│ │ ├── cl_d3d10.h
│ │ ├── cl_d3d11.h
│ │ ├── cl_dx9_media_sharing.h
│ │ ├── cl_dx9_media_sharing_intel.h
│ │ ├── cl_egl.h
│ │ ├── cl_ext.h
│ │ ├── cl_ext_intel.h
│ │ ├── cl_gl.h
│ │ ├── cl_gl_ext.h
│ │ ├── cl_icd.h
│ │ ├── cl_platform.h
│ │ ├── cl_va_api_media_sharing_intel.h
│ │ ├── cl_version.h
│ │ └── opencl.h
│ ├── CMakeLists.txt
│ ├── opencl.h
│ ├── opencl_impl.cpp
│ ├── opencl_impl.h
│ ├── opencl_impl_commandtracker.cpp
│ ├── opencl_impl_context.cpp
│ ├── opencl_impl_device.cpp
│ ├── opencl_impl_platform.cpp
│ ├── opencl_impl_program.cpp
│ ├── opencl_impl_programmanifest.cpp
│ ├── pch.cpp
│ └── pch.h
├── rpc
│ ├── 3fd-rpc.vcxproj
│ ├── 3fd-rpc.vcxproj.filters
│ ├── pch.cpp
│ ├── pch.h
│ ├── rpc_helpers.h
│ ├── rpc_impl_client.cpp
│ ├── rpc_impl_server.cpp
│ ├── rpc_impl_server.h
│ ├── rpc_impl_util.cpp
│ └── rpc_impl_util.h
├── sqlite
│ ├── 3fd-sqlite-winrt.vcxproj
│ ├── 3fd-sqlite-winrt.vcxproj.filters
│ ├── 3fd-sqlite.vcxproj
│ ├── 3fd-sqlite.vcxproj.filters
│ ├── CMakeLists.txt
│ ├── pch.cpp
│ ├── pch.h
│ ├── sqlite.h
│ ├── sqlite_databaseconn.cpp
│ ├── sqlite_dbconnpool.cpp
│ ├── sqlite_prepstatement.cpp
│ ├── sqlite_transaction.cpp
│ └── targetver.h
├── utils
│ ├── 3fd-utils-winrt.vcxproj
│ ├── 3fd-utils-winrt.vcxproj.filters
│ ├── 3fd-utils.vcxproj
│ ├── 3fd-utils.vcxproj.filters
│ ├── CMakeLists.txt
│ ├── algorithms.h
│ ├── asynchronous.cpp
│ ├── cmdline.cpp
│ ├── cmdline.h
│ ├── concurrency.h
│ ├── dynmempool.cpp
│ ├── event.cpp
│ ├── lockfreequeue.h
│ ├── memory.h
│ ├── memorypool.cpp
│ ├── pch.cpp
│ ├── pch.h
│ ├── serialization.cpp
│ ├── serialization.h
│ ├── sharedmutex.cpp
│ ├── targetver.h
│ ├── text.cpp
│ ├── text.h
│ ├── winrt.cpp
│ ├── winrt.h
│ ├── xml.cpp
│ └── xml.h
└── wws
│ ├── 3fd-wws.vcxproj
│ ├── 3fd-wws.vcxproj.filters
│ ├── host_impl.cpp
│ ├── host_impl.h
│ ├── pch.cpp
│ ├── pch.h
│ ├── proxy_impl.cpp
│ ├── proxy_impl.h
│ ├── utils.h
│ ├── utils_impl.cpp
│ ├── utils_impl.h
│ ├── utils_wserror_impl.cpp
│ ├── utils_xml_impl.cpp
│ ├── webservicehost.h
│ ├── webserviceproxy.h
│ └── wsdl-example.wsdl
├── Acknowledgements.txt
├── CMakeLists.txt
├── CertificateCreationProcedure.txt
├── IntegrationTests
├── AcmeTesting_w32.h
├── AcmeTesting_w32_srv.c
├── AcmeTesting_x64.h
├── AcmeTesting_x64_srv.c
├── CMakeLists.txt
├── CreateMsSqlSvcBrokerDB.sql
├── IntegrationTests.vcxproj
├── IntegrationTests.vcxproj.filters
├── RestoreSvcBrokerDbForLinux1.sql
├── RestoreSvcBrokerDbForLinux2.sql
├── RestoreSvcBrokerDbForWin.sql
├── UWP
│ ├── 5f042ca4-a62c-4960-b997-b0ff543d7792.3fd.config
│ ├── Assets
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── StoreLogo.png
│ │ └── Wide310x150Logo.scale-200.png
│ ├── IntegrationTestsApp.vcxproj
│ ├── IntegrationTestsApp.vcxproj.filters
│ ├── IntegrationTestsApp_TemporaryKey.pfx
│ └── Package.appxmanifest
├── application.config
├── calculator.wsdl.c
├── calculator.wsdl.h
├── install_manifest.txt
├── opencl-c-example-wrong.txt
├── opencl-c-example.txt
├── pch.cpp
├── pch.h
├── tests_broker.cpp
├── tests_core.cpp
├── tests_gc.cpp
├── tests_isam.cpp
├── tests_opencl.cpp
├── tests_rpc.cpp
├── tests_sqlite.cpp
└── tests_wws.cpp
├── LICENSE
├── MidlCompileRpcTestIDL.bat
├── README
├── SvcBrokerTest.bak
├── TestRpcClient
├── AcmeTesting_w32.h
├── AcmeTesting_w32_cli.c
├── AcmeTesting_x64.h
├── AcmeTesting_x64_cli.c
├── ReadMe.txt
├── TestRpcClient.vcxproj
├── TestRpcClient.vcxproj.filters
├── application.config
├── pch.cpp
├── pch.h
└── tests_rpc.cpp
├── TestShared
├── AcmeTesting.idl
├── calculator.wsdl
├── error_handling.cpp
├── main.cpp
├── rpc_test_shared.cpp
└── rpc_test_shared.h
├── TestWwsClient
├── ReadMe.txt
├── TestWwsClient.vcxproj
├── TestWwsClient.vcxproj.filters
├── application.config
├── calculator.wsdl.c
├── calculator.wsdl.h
├── pch.cpp
├── pch.h
└── tests_wws.cpp
├── UnitTests
├── CMakeLists.txt
├── UWP
│ ├── Assets
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── StoreLogo.png
│ │ └── Wide310x150Logo.scale-200.png
│ ├── Package.appxmanifest
│ ├── UnitTestsApp.vcxproj
│ ├── UnitTestsApp.vcxproj.filters
│ ├── UnitTestsApp_TemporaryKey.pfx
│ └── a2e1e6a8-499e-45a2-b51c-c26d343dbae3.3fd.config
├── UnitTests.vcxproj
├── UnitTests.vcxproj.filters
├── _dummy.xml
├── application.config
├── install_manifest.txt
├── pch.cpp
├── pch.h
├── tests_gc_arrayofedges.cpp
├── tests_gc_hashtable.cpp
├── tests_gc_vertex.cpp
├── tests_gc_vertexstore.cpp
├── tests_utils_algorithms.cpp
├── tests_utils_cache.cpp
├── tests_utils_cmdline.cpp
├── tests_utils_lockfreequeue.cpp
├── tests_utils_pool.cpp
├── tests_utils_serialization.cpp
├── tests_utils_text.cpp
└── tests_xml.cpp
├── WsutilCompileWwsTestWsdl.bat
├── btree
└── stx
│ ├── btree
│ ├── btree.h
│ ├── btree_set
│ └── btree_set.h
├── build.ps1
├── build.sh
├── gtest
├── CMakeLists.txt
├── LICENSE
├── cmake
│ └── internal_utils.cmake
├── include
│ └── gtest
│ │ ├── gtest-death-test.h
│ │ ├── gtest-message.h
│ │ ├── gtest-param-test.h
│ │ ├── gtest-param-test.h.pump
│ │ ├── gtest-printers.h
│ │ ├── gtest-spi.h
│ │ ├── gtest-test-part.h
│ │ ├── gtest-typed-test.h
│ │ ├── gtest.h
│ │ ├── gtest_pred_impl.h
│ │ ├── gtest_prod.h
│ │ └── internal
│ │ ├── gtest-death-test-internal.h
│ │ ├── gtest-filepath.h
│ │ ├── gtest-internal.h
│ │ ├── gtest-linked_ptr.h
│ │ ├── gtest-param-util-generated.h
│ │ ├── gtest-param-util-generated.h.pump
│ │ ├── gtest-param-util.h
│ │ ├── gtest-port.h
│ │ ├── gtest-string.h
│ │ ├── gtest-tuple.h
│ │ ├── gtest-tuple.h.pump
│ │ ├── gtest-type-util.h
│ │ └── gtest-type-util.h.pump
├── msvc
│ ├── gtest-md.sln
│ ├── gtest-md.vcxproj
│ ├── gtest-md.vcxproj.filters
│ ├── gtest-winrt.vcxproj
│ ├── gtest-winrt.vcxproj.filters
│ ├── gtest_main-md.vcxproj
│ ├── gtest_main-md.vcxproj.filters
│ ├── pch.cpp
│ ├── pch.h
│ └── targetver.h
└── src
│ ├── gtest-all.cc
│ ├── gtest-death-test.cc
│ ├── gtest-filepath.cc
│ ├── gtest-internal-inl.h
│ ├── gtest-port.cc
│ ├── gtest-printers.cc
│ ├── gtest-test-part.cc
│ ├── gtest-typed-test.cc
│ ├── gtest.cc
│ └── gtest_main.cc
├── install_dependencies.sh
├── install_vsrbdeps.sh
├── nanodbc
├── CMakeLists.txt
├── nanodbc.cpp
├── nanodbc.h
├── nanodbc.vcxproj
└── nanodbc.vcxproj.filters
├── rapidxml
├── license.txt
├── rapidxml.hpp
├── rapidxml_iterators.hpp
├── rapidxml_print.hpp
└── rapidxml_utils.hpp
└── sqlite3
├── CMakeLists.txt
├── sqlite3-winrt.vcxproj
├── sqlite3-winrt.vcxproj.filters
├── sqlite3.c
├── sqlite3.h
├── sqlite3.vcxproj
└── sqlite3.vcxproj.filters
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "(gdb) Launch IntegrationTests",
9 | "type": "cppdbg",
10 | "request": "launch",
11 | "program": "${workspaceFolder}/build/bin/IntegrationTests",
12 | "args": [ "--gtest_filter=Framework_OpenCL_TestCase.*" ],
13 | "stopAtEntry": false,
14 | "cwd": "${workspaceFolder}/build/bin",
15 | "environment": [],
16 | "externalConsole": false,
17 | "MIMode": "gdb",
18 | "setupCommands": [
19 | {
20 | "description": "Enable pretty-printing for gdb",
21 | "text": "-enable-pretty-printing",
22 | "ignoreFailures": true
23 | }
24 | ]
25 | },
26 | {
27 | "name": "(gdb) Launch UnitTests",
28 | "type": "cppdbg",
29 | "request": "launch",
30 | "program": "${workspaceFolder}/build/bin/UnitTests",
31 | "args": [ "--gtest_filter=*" ],
32 | "stopAtEntry": false,
33 | "cwd": "${workspaceFolder}/build/bin",
34 | "environment": [],
35 | "externalConsole": false,
36 | "MIMode": "gdb",
37 | "setupCommands": [
38 | {
39 | "description": "Enable pretty-printing for gdb",
40 | "text": "-enable-pretty-printing",
41 | "ignoreFailures": true
42 | }
43 | ]
44 | }
45 | ]
46 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
3 | "files.associations": {
4 | "stdexcept": "cpp"
5 | }
6 | }
--------------------------------------------------------------------------------
/3fd/broker/3fd-broker.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
11 |
12 |
13 | {28280e89-ef7e-4e9d-92ec-8696bc5f0d6b}
14 |
15 |
16 |
17 |
18 | pch
19 |
20 |
21 | Quelldateien
22 |
23 |
24 | Quelldateien
25 |
26 |
27 | Quelldateien
28 |
29 |
30 |
31 |
32 | pch
33 |
34 |
35 | Quelldateien
36 |
37 |
38 | Quelldateien
39 |
40 |
41 |
--------------------------------------------------------------------------------
/3fd/broker/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10)
2 |
3 | project(3fd-broker)
4 |
5 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
6 |
7 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
8 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-show-template-tree -fno-elide-type")
9 | elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
10 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
11 | endif()
12 |
13 | #####################
14 | # Macro definitions:
15 |
16 | add_definitions(
17 | -DENABLE_3FD_CST
18 | -DENABLE_3FD_ERR_IMPL_DETAILS
19 | )
20 |
21 | # NDEBUG when release mode:
22 | string(TOLOWER ${CMAKE_BUILD_TYPE} buildType)
23 | if(buildType STREQUAL release)
24 | add_definitions(-DNDEBUG)
25 | endif()
26 |
27 | ########################
28 | # Include directories:
29 |
30 | include_directories(
31 | "${PROJECT_SOURCE_DIR}"
32 | "${PROJECT_SOURCE_DIR}/../../"
33 | )
34 |
35 | ########################
36 | # Dependency libraries:
37 |
38 | # Static library source files:
39 | add_library(3fd-broker STATIC
40 | broker_impl.cpp
41 | broker_impl_reader.cpp
42 | broker_impl_writer.cpp
43 | )
44 |
45 | ################
46 | # Installation:
47 |
48 | install(
49 | TARGETS 3fd-broker
50 | DESTINATION "${PROJECT_SOURCE_DIR}/../../build/lib"
51 | )
--------------------------------------------------------------------------------
/3fd/broker/broker.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020 Part of 3FD project (https://github.com/faburaya/3fd)
3 | // It is FREELY distributed by the author under the Microsoft Public License
4 | // and the observance that it should only be used for the benefit of mankind.
5 | //
6 | #ifndef BROKER_H // header guard
7 | #define BROKER_H
8 |
9 | #include <3fd/core/preprocessing.h>
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | namespace _3fd {
17 | namespace broker {
18 |
19 | ///
20 | /// Enumerates options for service broker backend.
21 | ///
22 | enum class Backend : short
23 | {
24 | MsSqlServer
25 | //, OracleDatabase
26 | };
27 |
28 | ///
29 | /// Enumerates options for backend validation of message content.
30 | ///
31 | enum class MessageContentValidation : short
32 | {
33 | None,
34 | WellFormedXml
35 | };
36 |
37 | ///
38 | /// Packs the necessary info to specify a message type for creation or use.
39 | ///
40 | struct MessageTypeSpec
41 | {
42 | uint32_t nBytes;
43 | MessageContentValidation contentValidation;
44 | };
45 |
46 | ///
47 | /// Behaves just like std::future.
48 | ///
49 | class INTFOPT IAsyncDatabaseOperation : public std::future
50 | {
51 | public:
52 |
53 | IAsyncDatabaseOperation() = default;
54 |
55 | IAsyncDatabaseOperation(const IAsyncDatabaseOperation &) = delete;
56 |
57 | virtual ~IAsyncDatabaseOperation() = default;
58 |
59 | virtual const char *description() const noexcept = 0;
60 | };
61 |
62 | typedef std::function &&)> CallbackReceiveMessages;
63 |
64 | ///
65 | /// Represents a queue in the broker, from which
66 | /// a service can read its incoming messages.
67 | ///
68 | ///
69 | class QueueReader
70 | {
71 | private:
72 |
73 | const std::string m_dbConnString;
74 | const std::string m_serviceURL;
75 |
76 | public:
77 |
78 | QueueReader(Backend svcBrokerBackend,
79 | const std::string &connString,
80 | const std::string &serviceURL,
81 | const MessageTypeSpec &msgTypeSpec);
82 |
83 | QueueReader(const QueueReader &) = delete;
84 |
85 | std::unique_ptr ReadMessages(uint16_t msgCountStepLimit,
86 | uint16_t msgRecvTimeout,
87 | const CallbackReceiveMessages &callbackRecvMessages);
88 | };
89 |
90 | ///
91 | /// Represents a queue in the broker, into which
92 | /// a service can write messages to another.
93 | ///
94 | ///
95 | class QueueWriter
96 | {
97 | private:
98 |
99 | const std::string m_dbConnString;
100 | const std::string m_serviceURL;
101 |
102 | public:
103 |
104 | QueueWriter(Backend svcBrokerBackend,
105 | const std::string &dbConnString,
106 | const std::string &serviceURL,
107 | const MessageTypeSpec &msgTypeSpec);
108 |
109 | QueueWriter(const QueueWriter &) = delete;
110 |
111 | std::unique_ptr WriteMessages(const std::vector &messages);
112 | };
113 |
114 | }// end of namespace broker
115 | }// end of namespace _3fd
116 |
117 | #endif // end of header guard
118 |
--------------------------------------------------------------------------------
/3fd/broker/broker_impl.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020 Part of 3FD project (https://github.com/faburaya/3fd)
3 | // It is FREELY distributed by the author under the Microsoft Public License
4 | // and the observance that it should only be used for the benefit of mankind.
5 | //
6 | #ifndef BROKER_IMPL_H // header guard
7 | #define BROKER_IMPL_H
8 |
9 | #include "broker.h"
10 | #include <3fd/utils/concurrency.h>
11 | #include <3fd/utils/text.h>
12 |
13 | #ifdef _WIN32
14 | # define NANODBC_ENABLE_UNICODE
15 | #endif
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | #ifdef _WIN32
22 | // nanodbc for Windows uses UCS-2
23 | # define _U(TEXT) L ## TEXT
24 | typedef wchar_t char_t;
25 | typedef _3fd::utils::TextUcs2 Text;
26 | #else
27 | // nanodbc for POSIX uses UTF-8
28 | # define _U(TEXT) TEXT
29 | typedef char char_t;
30 | typedef _3fd::utils::TextUtf8 Text;
31 | #endif
32 |
33 | #define catch_and_handle_exception(WHEN) catch(...) { HandleException(WHEN); }
34 |
35 | #define catch_and_log_exception(WHEN) catch(...) { LogException(WHEN); }
36 |
37 | namespace _3fd
38 | {
39 | namespace broker
40 | {
41 | void HandleException(const char *when);
42 |
43 | void LogException(const char *when) noexcept;
44 |
45 | const char_t *ToString(Backend backend);
46 |
47 | const char_t *ToString(MessageContentValidation msgContentValidation);
48 |
49 | ///
50 | /// Provides a resilient database ODBC connection.
51 | ///
52 | class DatabaseSession
53 | {
54 | private:
55 |
56 | nanodbc::connection m_dbConnection;
57 | const std::string m_connectionString;
58 |
59 | public:
60 |
61 | DatabaseSession(const std::string &connString);
62 |
63 | DatabaseSession(const DatabaseSession &) = delete;
64 |
65 | nanodbc::connection &GetConnection();
66 | };
67 |
68 | ///
69 | /// Provides locks to extract messages from the service broker queue.
70 | ///
71 | class LockProvider
72 | {
73 | private:
74 |
75 | static std::unique_ptr uniqueInstance;
76 | static std::once_flag initSyncFlag;
77 |
78 | utils::CacheForSharedResources m_cacheOfMutexes;
79 |
80 | LockProvider() = default;
81 |
82 | struct Lock
83 | {
84 | std::shared_ptr mutex;
85 | std::unique_lock lock;
86 |
87 | Lock(const Lock &) = delete;
88 |
89 | Lock(std::shared_ptr p_mutex)
90 | : mutex(p_mutex)
91 | , lock(*p_mutex)
92 | {
93 | }
94 |
95 | Lock(Lock &&ob)
96 | : mutex(std::move(ob.mutex))
97 | , lock(std::move(ob.lock))
98 | {
99 | }
100 |
101 | ~Lock()
102 | {
103 | lock.unlock(); // first unlock
104 | mutex.reset(); // then release reference to the mutex
105 | }
106 | };
107 |
108 | public:
109 |
110 | LockProvider(const LockProvider &) = delete;
111 |
112 | static LockProvider &GetInstance();
113 |
114 | Lock GetLockFor(const std::string &brokerSvcUrl);
115 | };
116 |
117 | }// end of namespace broker
118 | }// end of namespace _3fd
119 |
120 | #endif // end of header guard
121 |
--------------------------------------------------------------------------------
/3fd/broker/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht
2 |
3 | #include "pch.h"
4 |
5 | // Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich.
6 |
--------------------------------------------------------------------------------
/3fd/broker/pch.h:
--------------------------------------------------------------------------------
1 | #include <3fd/core/pch.h>
--------------------------------------------------------------------------------
/3fd/core/3fd-config-template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/3fd/core/3fd-core-winrt.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms
7 |
8 |
9 | {22f307b0-cf3c-4cc8-97a1-6c62e59bacde}
10 |
11 |
12 |
13 |
14 | pch
15 |
16 |
17 | pch
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | pch
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | Resource Files
59 |
60 |
61 |
--------------------------------------------------------------------------------
/3fd/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10)
2 |
3 | project(3fd-core)
4 |
5 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
6 |
7 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
8 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-show-template-tree -fno-elide-type")
9 | elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
10 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
11 | endif()
12 |
13 | #####################
14 | # Macro definitions:
15 |
16 | add_definitions(
17 | -DENABLE_3FD_CST
18 | -DENABLE_3FD_ERR_IMPL_DETAILS
19 | )
20 |
21 | # NDEBUG when release mode:
22 | string(TOLOWER ${CMAKE_BUILD_TYPE} buildType)
23 | if(buildType STREQUAL release)
24 | add_definitions(-DNDEBUG)
25 | endif()
26 |
27 | ########################
28 | # Include directories:
29 |
30 | include_directories(
31 | "${PROJECT_SOURCE_DIR}"
32 | "${PROJECT_SOURCE_DIR}/../../"
33 | "${PROJECT_SOURCE_DIR}/../../btree"
34 | )
35 |
36 | ########################
37 | # Dependency libraries:
38 |
39 | # Static library source files:
40 | add_library(3fd-core STATIC
41 | callstacktracer.cpp
42 | configuration.cpp
43 | dependencies.cpp
44 | exceptions.cpp
45 | gc_addresseshashtable.cpp
46 | gc_arrayofedges.cpp
47 | gc_garbagecollector.cpp
48 | gc_memorydigraph.cpp
49 | gc_messages.cpp
50 | gc_vertex.cpp
51 | gc_vertexstore.cpp
52 | logger.cpp
53 | logger_console.cpp
54 | logger_dsa.cpp
55 | runtime.cpp
56 | )
57 |
58 | ################
59 | # Installation:
60 |
61 | install(
62 | TARGETS 3fd-core
63 | DESTINATION "${PROJECT_SOURCE_DIR}/../../build/lib"
64 | )
--------------------------------------------------------------------------------
/3fd/core/dependencies.h:
--------------------------------------------------------------------------------
1 | #ifndef DEPENDENCIES_H
2 | #define DEPENDENCIES_H
3 |
4 | #include
5 | #include
6 |
7 | #ifdef _WIN32 // Microsoft Windows:
8 | # include
9 | #else // POSIX:
10 | # define HINSTANCE void *
11 | #endif
12 |
13 | namespace _3fd
14 | {
15 | namespace core
16 | {
17 | ///
18 | /// Takes care of the framework's DLL dependencies.
19 | ///
20 | class Dependencies
21 | {
22 | private:
23 |
24 | static std::unique_ptr singleInstancePtr;
25 | static std::mutex singleInstanceCreationMutex;
26 |
27 | Dependencies();
28 |
29 | public:
30 |
31 | Dependencies(const Dependencies &) = delete;
32 |
33 | ~Dependencies(); // must be public so the 'unique_ptr<>' holding the single object can destroy it
34 |
35 | // Get the singleton instance.
36 | static Dependencies &Get();
37 |
38 | #ifdef _3FD_OPENCL_SUPPORT
39 | private:
40 | HINSTANCE m_openclDllHandle;
41 |
42 | public:
43 | HINSTANCE &OpenCLDllHandle;
44 | #endif
45 | };
46 |
47 | }// namespace core
48 | }// namespace _3fd
49 |
50 | #endif // end of header guard
--------------------------------------------------------------------------------
/3fd/core/gc.h:
--------------------------------------------------------------------------------
1 | #ifndef GC_H
2 | #define GC_H
3 |
4 | #include <3fd/core/gc_memorydigraph.h>
5 | #include <3fd/utils/concurrency.h>
6 | #include <3fd/utils/lockfreequeue.h>
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | /* Convention:
13 |
14 | Access point - a sptr object which does not belong to a region of memory managed
15 | by the garbage collector. In other words, it is a sptr object that is not inside
16 | any MemBlock region.
17 | */
18 | namespace _3fd
19 | {
20 | namespace memory
21 | {
22 | ///
23 | /// The interface that all GC messages must implement.
24 | ///
25 | class INTFOPT IMessage
26 | {
27 | public:
28 |
29 | virtual ~IMessage() {}
30 |
31 | virtual void Execute(MemoryDigraph &graph) = 0;
32 | };
33 |
34 | ///
35 | /// Implements the garbage collector engine.
36 | ///
37 | class GarbageCollector
38 | {
39 | private:
40 |
41 | std::thread m_thread;
42 | std::exception_ptr m_error;
43 | MemoryDigraph m_memoryDigraph;
44 | utils::LockFreeQueue m_messagesQueue;
45 | utils::Event m_terminationEvent;
46 |
47 | GarbageCollector();
48 |
49 | void GCThreadProc();
50 |
51 | // Singleton needs:
52 |
53 | static std::mutex singleInstanceCreationMutex;
54 | static GarbageCollector *uniqueObjectPtr;
55 | static GarbageCollector *CreateInstance();
56 |
57 | public:
58 |
59 | static GarbageCollector &GetInstance();
60 |
61 | static void Shutdown();
62 |
63 | GarbageCollector(const GarbageCollector &) = delete;
64 |
65 | ~GarbageCollector();
66 |
67 | void RegisterNewObject(
68 | void *sptrObjAddr,
69 | void *pointedAddr,
70 | size_t blockSize,
71 | FreeMemProc freeMemCallback
72 | );
73 |
74 | void UpdateReference(void *leftSptrObjAddr, void *rightSptrObjAddr);
75 |
76 | void ReleaseReference(void *sptrObjAddr);
77 |
78 | void UnregisterAbortedObject(void *sptrObjAddr);
79 |
80 | void RegisterSptr(void *sptrObjAddr, void *pointedAddr);
81 |
82 | void RegisterSptrCopy(void *leftSptrObjAddr, void *rightSptrObjAddr);
83 |
84 | void UnregisterSptr(void *sptrObjAddr);
85 | };
86 |
87 | }// end of namespace memory
88 | }// end of namespace _3fd
89 |
90 | #endif // end of header guard
91 |
--------------------------------------------------------------------------------
/3fd/core/gc_arrayofedges.h:
--------------------------------------------------------------------------------
1 | #ifndef GC_ARRAYOFEDGES_H // header guard
2 | #define GC_ARRAYOFEDGES_H
3 |
4 | #include
5 | #include
6 |
7 | /*
8 | The convention here is
9 |
10 | + Regular vertices are passed as 'Vertex *'
11 | + Root vertices are passed as 'void *'
12 | + Memory addresses in general are handled as 'void *'
13 | */
14 | namespace _3fd
15 | {
16 | namespace memory
17 | {
18 | class Vertex;
19 |
20 | ///
21 | /// A dinamically resizable array of edges,
22 | /// for implementation of directed graphs.
23 | ///
24 | class ArrayOfEdges
25 | {
26 | private:
27 |
28 | ///
29 | /// Holds pointers to all vertices, that represent receiving edges.
30 | ///
31 | void **m_array;
32 |
33 | uint32_t m_arraySize;
34 |
35 | uint32_t m_arrayCapacity;
36 |
37 | ///
38 | /// Counting of how many root vertices are in the array.
39 | ///
40 | uint32_t m_rootCount;
41 |
42 | void CreateEdgeImpl(void *vtx);
43 |
44 | void RemoveEdgeImpl(void *vtx);
45 |
46 | void EvaluateShrinkCapacity();
47 |
48 | public:
49 |
50 | ArrayOfEdges();
51 |
52 | ArrayOfEdges(const ArrayOfEdges &) = delete;
53 |
54 | ~ArrayOfEdges();
55 |
56 | void AddEdge(void *vtxRoot);
57 |
58 | void AddEdge(Vertex *vtxRegular);
59 |
60 | void RemoveEdge(void *vtxRoot);
61 |
62 | void RemoveEdge(Vertex *vtxRegular);
63 |
64 | void Clear();
65 |
66 | uint32_t Size() const;
67 |
68 | bool HasRootEdges() const;
69 |
70 | void ForEachRegular(const std::function &callback);
71 | };
72 |
73 | }// end of namespace memory
74 | }// end of namespace _3fd
75 |
76 | #endif // end of header guard
77 |
--------------------------------------------------------------------------------
/3fd/core/gc_common.h:
--------------------------------------------------------------------------------
1 | #ifndef GC_COMMON_H
2 | #define GC_COMMON_H
3 |
4 | #include
5 |
6 | namespace _3fd
7 | {
8 | namespace memory
9 | {
10 | typedef void (*FreeMemProc)(void *addr, bool destroy);
11 |
12 | ///
13 | /// Frees memory allocated by the GC.
14 | /// This is compiled by the client code compiler.
15 | ///
16 | /// The memory address.
17 | template
18 | void FreeMemAddr(void *addr, bool destroy = true)
19 | {
20 | auto ptr = static_cast (addr);
21 |
22 | if (destroy)
23 | ptr->X::~X();
24 |
25 | # ifdef _WIN32
26 | _aligned_free(ptr);
27 | # else
28 | free(ptr);
29 | # endif
30 | }
31 |
32 | void *AllocMemoryAndRegisterWithGC(
33 | size_t size,
34 | void *sptrObjAddr,
35 | FreeMemProc freeMemCallback
36 | );
37 |
38 | }// end of namespace memory
39 | }// end of namespace _3fd
40 |
41 | #endif // end of header guard
42 |
--------------------------------------------------------------------------------
/3fd/core/gc_memorydigraph.h:
--------------------------------------------------------------------------------
1 | #ifndef GC_MEMORYDIGRAPH_H // header guard
2 | #define GC_MEMORYDIGRAPH_H
3 |
4 | /*
5 | Here is implemented a directed graph tuned for reachability analysis used by the garbage collector.
6 | In this graph, each vertex is either a safe pointer or a piece of garbage collected memmory (which
7 | might contain a safe pointer inside it). The vertices are distinguished as regular or root. A root
8 | vertex is a safe pointer allocated in memory not managed by the garbage collector. That means client
9 | code uses such pointers to access the remaining of the graph (garbage collected memory pieces), that
10 | are the regular vertices.
11 |
12 | This distinction is central for the GC to perform reachability analysis. When a given piece of memory
13 | is not connected to any root vertex, that means it became out of reach and has to be collected. This
14 | approach is not vulnerable to cyclic references, unlike reference counting.
15 | */
16 |
17 | #include <3fd/core/gc_vertexstore.h>
18 | #include <3fd/core/gc_addresseshashtable.h>
19 |
20 | namespace _3fd
21 | {
22 | namespace memory
23 | {
24 | ///
25 | /// Directed graph representing the connections made by safe pointers
26 | /// between pieces of memory managed by the GC.
27 | ///
28 | class MemoryDigraph
29 | {
30 | private:
31 |
32 | ///
33 | /// An unsorted map of elements representing objects.
34 | ///
35 | ///
36 | /// A hash table here might improve performance and
37 | /// can be used because it does not have to be sorted.
38 | ///
39 | AddressesHashTable m_sptrObjects;
40 |
41 | VertexStore m_vertices;
42 |
43 | void MakeReference(AddressesHashTable::Element &sptrObjHashTableElem, Vertex *pointedMemBlock);
44 |
45 | void MakeReference(AddressesHashTable::Element &sptrObjHashTableElem, void *pointedAddr);
46 |
47 | void UnmakeReference(AddressesHashTable::Element &sptrObjHashTableElem, bool allowDestruction);
48 |
49 | public:
50 |
51 | MemoryDigraph() {}
52 |
53 | MemoryDigraph(const MemoryDigraph &) = delete;
54 |
55 | void ShrinkVertexPool();
56 |
57 | void AddRegularVertex(void *memAddr, size_t blockSize, FreeMemProc freeMemCallback);
58 |
59 | void AddPointer(void *pointerAddr, void *pointedAddr);
60 |
61 | void AddPointerOnCopy(void *leftPointerAddr, void *rightPointerAddr);
62 |
63 | void ResetPointer(void *pointerAddr, void *newPointedAddr, bool allowDtion);
64 |
65 | void ResetPointer(void *pointerAddr, void *otherPointerAddr);
66 |
67 | void ReleasePointer(void *pointerAddr);
68 |
69 | void RemovePointer(void *pointerAddr);
70 | };
71 |
72 | }// end of namespace memory
73 | }// end of namespace _3fd
74 |
75 | #endif // end of header guard
76 |
--------------------------------------------------------------------------------
/3fd/core/gc_vertexstore.h:
--------------------------------------------------------------------------------
1 | #ifndef GC_VERTEXSTORE_H // header guard
2 | #define GC_VERTEXSTORE_H
3 |
4 | #include <3fd/core/gc_common.h>
5 | #include <3fd/core/gc_vertex.h>
6 | #include <3fd/utils/memory.h>
7 | #include
8 |
9 | namespace _3fd
10 | {
11 | namespace memory
12 | {
13 | ///
14 | /// Represents a store of vertices allocated from a pool.
15 | /// The vertices represent memory blocks.
16 | ///
17 | class VertexStore
18 | {
19 | private:
20 |
21 | utils::DynamicMemPool m_memBlocksPool;
22 |
23 | // Compared to a binary tree, a B+Tree can render better cache efficiency
24 | typedef stx::btree_set SetOfMemBlocks;
25 |
26 | ///
27 | /// A sorted set of garbage collected pieces of memory,
28 | /// ordered by the memory addresses of those pieces.
29 | ///
30 | ///
31 | /// Although a hash table could be faster, it is not sorted, hence cannot be used.
32 | ///
33 | SetOfMemBlocks m_vertices;
34 |
35 | public:
36 |
37 | VertexStore();
38 |
39 | VertexStore(const VertexStore &) = delete;
40 |
41 | void ShrinkPool();
42 |
43 | void AddVertex(void *memAddr, size_t blockSize, FreeMemProc freeMemCallback);
44 |
45 | void RemoveVertex(Vertex *memBlock);
46 |
47 | Vertex *GetVertex(void *memAddr) const;
48 |
49 | Vertex *GetContainerVertex(void *addr) const;
50 | };
51 |
52 | }// end of namespace memory
53 | }// end of namespace _3fd
54 |
55 | #endif // end of header guard
56 |
--------------------------------------------------------------------------------
/3fd/core/logger_console.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020 Part of 3FD project (https://github.com/faburaya/3fd)
3 | // It is FREELY distributed by the author under the Microsoft Public License
4 | // and the observance that it should only be used for the benefit of mankind.
5 | //
6 | #include "pch.h"
7 | #include "logger.h"
8 |
9 | namespace _3fd
10 | {
11 | namespace core
12 | {
13 | ///
14 | /// Implements the contract of while hiding
15 | /// the particular implementation for IO access directly to the system.
16 | ///
17 | class StandardOutputAccess : public ILogFileAccess
18 | {
19 | public:
20 |
21 | std::ostream &GetStream() override
22 | {
23 | return std::cout;
24 | }
25 |
26 | bool HasError() const override
27 | {
28 | return false;
29 | }
30 |
31 | void ShiftToNewLogFile() override
32 | {
33 | }
34 |
35 | uint64_t GetFileSize() const override
36 | {
37 | return 4096;
38 | }
39 | };
40 |
41 | std::unique_ptr GetConsoleAccess()
42 | {
43 | return std::unique_ptr(dbg_new StandardOutputAccess());
44 | }
45 |
46 | }// end of namespace core
47 | }// end of namespace _3fd
48 |
--------------------------------------------------------------------------------
/3fd/core/logger_dsa.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020 Part of 3FD project (https://github.com/faburaya/3fd)
3 | // It is FREELY distributed by the author under the Microsoft Public License
4 | // and the observance that it should only be used for the benefit of mankind.
5 | //
6 | #include "pch.h"
7 | #include "configuration.h"
8 | #include "exceptions.h"
9 | #include "logger.h"
10 |
11 | #include "3fd/utils/serialization.h"
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | namespace _3fd
18 | {
19 | namespace core
20 | {
21 | ///
22 | /// Implements the contract of while hiding
23 | /// the particular implementation for IO access directly to the system.
24 | ///
25 | class DirectSystemFileAccess : public ILogFileAccess
26 | {
27 | private:
28 |
29 | const std::filesystem::path m_filePath;
30 |
31 | std::ofstream m_fileStream;
32 |
33 | void OpenStream(std::ofstream &ofs)
34 | {
35 | ofs.open(m_filePath.string(), std::ios::app | std::ios::out);
36 | if (ofs.is_open() == false)
37 | throw AppException("Could not open text log file", m_filePath.string());
38 | }
39 |
40 | public:
41 |
42 | DirectSystemFileAccess(const std::string &filePath)
43 | : m_filePath(filePath)
44 | {
45 | OpenStream(m_fileStream);
46 | }
47 |
48 | std::ostream &GetStream() override
49 | {
50 | return m_fileStream;
51 | }
52 |
53 | bool HasError() const override
54 | {
55 | return m_fileStream.bad();
56 | }
57 |
58 | void ShiftToNewLogFile() override
59 | {
60 | m_fileStream.close(); // first close the stream to the current log file
61 |
62 | using std::chrono::system_clock;
63 | auto now = system_clock::to_time_t(system_clock::now());
64 |
65 | using namespace std::filesystem;
66 |
67 | std::array pathBuffer;
68 | utils::SerializeTo(pathBuffer,
69 | m_filePath.parent_path().string(),
70 | path::preferred_separator,
71 | m_filePath.stem().string(),
72 | '[', ctime(&now), "].log.txt");
73 |
74 | path archivedLogFilePath = pathBuffer.data();
75 |
76 | try
77 | {
78 | rename(m_filePath, archivedLogFilePath);
79 | }
80 | catch (filesystem_error &)
81 | {
82 | std::ostringstream oss;
83 | oss << m_filePath.string() << " -> " << archivedLogFilePath.string();
84 | throw AppException("Failed to shift log file", oss.str());
85 | }
86 |
87 | OpenStream(m_fileStream); // start new file
88 | }
89 |
90 | uint64_t GetFileSize() const override
91 | {
92 | try
93 | {
94 | return std::filesystem::file_size(m_filePath);
95 | }
96 | catch (std::filesystem::filesystem_error &ex)
97 | {
98 | throw AppException("Failed to get size of log file",
99 | StdLibExt::GetDetailsFromSystemError(ex.code()));
100 | }
101 | }
102 | };
103 |
104 | std::unique_ptr GetFileAccess(const string &loggerId)
105 | {
106 | return std::unique_ptr(dbg_new DirectSystemFileAccess(loggerId + ".log.txt"));
107 | }
108 |
109 | }// end of namespace core
110 | }// end of namespace _3fd
111 |
--------------------------------------------------------------------------------
/3fd/core/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht
2 |
3 | #include "pch.h"
4 |
5 | // Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich.
6 |
--------------------------------------------------------------------------------
/3fd/core/pch.h:
--------------------------------------------------------------------------------
1 | // pch.h: Dies ist eine vorkompilierte Headerdatei.
2 | // Die unten aufgeführten Dateien werden nur einmal kompiliert, um die Buildleistung für zukünftige Builds zu verbessern.
3 | // Dies wirkt sich auch auf die IntelliSense-Leistung aus, Codevervollständigung und viele Features zum Durchsuchen von Code eingeschlossen.
4 | // Die hier aufgeführten Dateien werden jedoch ALLE neu kompiliert, wenn mindestens eine davon zwischen den Builds aktualisiert wird.
5 | // Fügen Sie hier keine Dateien hinzu, die häufig aktualisiert werden sollen, da sich so der Leistungsvorteil ins Gegenteil verkehrt.
6 |
7 | #ifndef PCH_H
8 | #define PCH_H
9 |
10 | # ifdef _MSC_VER // Visual Studio:
11 | # include
12 |
13 | # ifndef NDEBUG // CRT support for memory leak detection:
14 | # define _CRTDBG_MAP_ALLOC
15 | # include
16 | # include
17 | # endif
18 |
19 | // Windows Desktop App:
20 | # if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
21 |
22 | # ifdef TESTING // Test application:
23 | # include "targetver.h"
24 | # include
25 | # include
26 | # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
27 | # define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
28 | # include
29 |
30 | # else // Static library:
31 | # include "targetver.h"
32 | # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
33 | # endif
34 |
35 | # else // Windows Store Apps:
36 |
37 | # ifdef TESTING // Test application:
38 | # include "winrt/Windows.ApplicationModel.Core.h"
39 |
40 | # define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
41 | # include
42 |
43 | # else // Static library:
44 | # include "targetver.h"
45 | # ifndef WIN32_LEAN_AND_MEAN
46 | # define WIN32_LEAN_AND_MEAN
47 | # endif
48 | # endif
49 |
50 | # include
51 | # include
52 |
53 | # endif
54 |
55 | # else // QtCreator & other IDE's:
56 | # ifdef TESTING // Test application:
57 | # include
58 | # endif
59 |
60 | # endif
61 |
62 | #endif // end of header guard
63 |
--------------------------------------------------------------------------------
/3fd/core/preprocessing.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020 Part of 3FD project (https://github.com/faburaya/3fd)
3 | // It is FREELY distributed by the author under the Microsoft Public License
4 | // and the observance that it should only be used for the benefit of mankind.
5 | //
6 | #ifndef PREPROCESSING_H
7 | #define PREPROCESSING_H
8 |
9 | #define STATUS_OKAY false
10 | #define STATUS_FAIL true
11 |
12 | // If using a GCC compiler:
13 | #ifdef __GNUG__
14 | # define __FUNCTION__ __PRETTY_FUNCTION__
15 | #endif
16 |
17 | #ifdef _MSC_VER // Microsoft Visual Studio:
18 | # define INTFOPT __declspec(novtable)
19 |
20 | # if _MSC_VER >= 1900
21 | # define _3FD_HAS_STLOPTIMALLOC
22 | # endif
23 |
24 | #else // Other Compilers:
25 | # define INTFOPT
26 | # define _ASSERTE assert
27 | # include
28 | #endif
29 |
30 | // Platform support for particular modules/features/resources:
31 | #ifdef _WIN32
32 | # include
33 | # define _newLine_ "\n"
34 |
35 | # ifdef _DEBUG
36 | # define dbg_new new (_NORMAL_BLOCK , __FILE__ , __LINE__)
37 | # else
38 | # define dbg_new new
39 | # endif
40 |
41 | # if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
42 | // Windows Desktop Apps only:
43 | # define _3FD_PLATFORM_WIN32API
44 | # define _3FD_POCO_SUPPORT
45 | # define _3FD_ESENT_SUPPORT
46 | # define _3FD_OPENCL_SUPPORT
47 | # define _3FD_CONSOLE_AVAILABLE
48 |
49 | # elif defined WINAPI_FAMILY_SYSTEM
50 | // UWP Apps only:
51 | # define _3FD_PLATFORM_WINRT
52 | # define _3FD_PLATFORM_WINRT_UWP
53 | # define _3FD_ESENT_SUPPORT
54 |
55 | # elif WINAPI_FAMILY == WINAPI_FAMILY_PC_APP
56 | // Windows Store Apps (& UWP) only:
57 | # define _3FD_PLATFORM_WINRT
58 | # define _3FD_PLATFORM_WINRT_PC
59 | # define _3FD_ESENT_SUPPORT
60 |
61 | # elif WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
62 | // Windows Phone 8 Store Apps only:
63 | # define _3FD_PLATFORM_WINRT
64 | # define _3FD_PLATFORM_WINRT_PHONE
65 | # endif
66 |
67 | #elif defined __linux__ // Linux only:
68 | # define _3FD_POCO_SUPPORT
69 | # define _3FD_OPENCL_SUPPORT
70 | # define _3FD_CONSOLE_AVAILABLE
71 | # define _newLine_ "\r\n"
72 | # define dbg_new new
73 |
74 | #elif defined __unix__ // Unix only:
75 | # define _3FD_POCO_SUPPORT
76 | # define _3FD_CONSOLE_AVAILABLE
77 | # define _newLine_ "\r\n"
78 | # define dbg_new new
79 | #endif
80 |
81 | // These instructions have they definition depending on whether this is a release compilation:
82 | #ifdef NDEBUG
83 | # define RELEASE_DEBUG_SWITCH(STATEMENT1, STATEMENT2) STATEMENT1
84 | # define ONDEBUG(CODE_LINE) ;
85 | #else
86 | # define RELEASE_DEBUG_SWITCH(STATEMENT1, STATEMENT2) STATEMENT2
87 | # define ONDEBUG(CODE_LINE) CODE_LINE
88 | #endif
89 |
90 | // Some few useful "keywords":
91 | #define const_this const_cast (*this)
92 |
93 | // These are the calls that should be used for handling errors: it uses the RuntimeManager class:
94 | #ifdef ENABLE_3FD_CST
95 | # // Obligatory use if you want call stack tracing feature:
96 | # define CALL_STACK_TRACE _3fd::core::CallStackTracer::TrackCall(__FILE__, __LINE__, __FUNCTION__); _3fd::core::StackDeactivationTrigger _stackDeactTrigObj;
97 | #else
98 | # define CALL_STACK_TRACE
99 | #endif
100 |
101 | #endif // header guard
102 |
--------------------------------------------------------------------------------
/3fd/core/runtime.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNTIME_H
2 | #define RUNTIME_H
3 |
4 | #include <3fd/core/preprocessing.h>
5 | #include <3fd/core/callstacktracer.h>
6 | #include <3fd/core/logger.h>
7 | #include
8 |
9 | namespace _3fd
10 | {
11 | namespace core
12 | {
13 | ///
14 | /// An object to be allocated on the stack which is responsible for
15 | /// starting or stopping the framework instance for the current thread.
16 | ///
17 | class FrameworkInstance
18 | {
19 | private:
20 |
21 | std::string m_moduleName;
22 |
23 | #ifdef _3FD_PLATFORM_WIN32API
24 | bool m_isComLibInitialized;
25 | #endif
26 | public:
27 |
28 | FrameworkInstance(const FrameworkInstance &) = delete;
29 |
30 | ~FrameworkInstance();
31 |
32 | #ifdef _3FD_PLATFORM_WIN32API
33 |
34 | enum MsComThreadModel { ComSingleThreaded, ComMultiThreaded };
35 |
36 | FrameworkInstance();
37 |
38 | FrameworkInstance(MsComThreadModel threadModel);
39 |
40 | #elif defined _3FD_PLATFORM_WINRT
41 |
42 | FrameworkInstance(const char *thisComName = "UNKNOWN");
43 | #else
44 | FrameworkInstance();
45 | #endif
46 | };
47 |
48 | void SetupMemoryLeakDetection();
49 |
50 | }// end of namespace core
51 | }// end of namespace _3fd
52 |
53 | #endif // header guard
--------------------------------------------------------------------------------
/3fd/core/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert.
4 |
5 | // Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und
6 | // legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/3fd/isam/3fd-isam-winrt.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms
7 |
8 |
9 | {8080a303-a765-41d0-9fd3-7b130ad7bcb8}
10 |
11 |
12 |
13 |
14 | pch
15 |
16 |
17 |
18 |
19 | pch
20 |
21 |
22 |
23 |
24 | pch
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/3fd/isam/3fd-isam.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
11 |
12 |
13 | {d018c4c3-12de-4e77-9c7f-014494b49838}
14 |
15 |
16 |
17 |
18 | pch
19 |
20 |
21 | Quelldateien
22 |
23 |
24 | Quelldateien
25 |
26 |
27 |
28 |
29 | pch
30 |
31 |
32 | Quelldateien
33 |
34 |
35 | Quelldateien
36 |
37 |
38 | Quelldateien
39 |
40 |
41 | Quelldateien
42 |
43 |
44 | Quelldateien
45 |
46 |
47 | Quelldateien
48 |
49 |
50 | Quelldateien
51 |
52 |
53 | Quelldateien
54 |
55 |
56 | Quelldateien
57 |
58 |
59 | Quelldateien
60 |
61 |
62 | Quelldateien
63 |
64 |
65 |
--------------------------------------------------------------------------------
/3fd/isam/isam_impl_transaction.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "isam_impl.h"
3 |
4 | namespace _3fd
5 | {
6 | namespace isam
7 | {
8 | ///////////////////////////
9 | // Transaction Class
10 | ///////////////////////////
11 |
12 | ///
13 | /// Finalizes an instance of the class.
14 | ///
15 | TransactionImpl::~TransactionImpl()
16 | {
17 | // If the object was not moved and the transaction is not yet commited, rollback:
18 | if (m_jetSession != NULL && m_committed == false)
19 | {
20 | CALL_STACK_TRACE;
21 | auto rcode = JetRollback(m_jetSession, 0);
22 | ErrorHelper::LogError(NULL, m_jetSession, rcode, "Failed to rollback ISAM transaction", core::Logger::PRIO_CRITICAL);
23 | }
24 | }
25 |
26 | ///
27 | /// Finalizes an instance of the class.
28 | ///
29 | Transaction::~Transaction()
30 | {
31 | delete m_pimpl;
32 | }
33 |
34 | ///
35 | /// Commit transaction.
36 | ///
37 | ///
38 | /// Whether to wait for the transaction to be flushed to the transaction log file before returning to the caller.
39 | ///
40 | void TransactionImpl::Commit(bool blockingOp)
41 | {
42 | CALL_STACK_TRACE;
43 | auto rcode = JetCommitTransaction(m_jetSession, blockingOp ? 0 : JET_bitCommitLazyFlush);
44 | ErrorHelper::HandleError(NULL, m_jetSession, rcode, "Failed to commit ISAM transaction");
45 | m_committed = true;
46 | }
47 |
48 | ///
49 | /// Commit transaction.
50 | ///
51 | ///
52 | /// Whether to wait for the transaction to be flushed to the transaction log file before returning to the caller.
53 | ///
54 | void Transaction::Commit(bool blockingOp)
55 | {
56 | m_pimpl->Commit(blockingOp);
57 | }
58 |
59 | }// end namespace isam
60 | }// end namespace _3fd
61 |
--------------------------------------------------------------------------------
/3fd/isam/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht
2 |
3 | #include "pch.h"
4 |
5 | // Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich.
6 |
--------------------------------------------------------------------------------
/3fd/isam/pch.h:
--------------------------------------------------------------------------------
1 | #include "3fd\core\pch.h"
--------------------------------------------------------------------------------
/3fd/isam/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert.
4 |
5 | // Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und
6 | // legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/3fd/opencl/3fd-opencl.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
11 |
12 |
13 | {5559c76b-a3dc-4385-9872-c0367b24685f}
14 |
15 |
16 |
17 |
18 | pch
19 |
20 |
21 | Quelldateien
22 |
23 |
24 | Quelldateien
25 |
26 |
27 | Quelldateien
28 |
29 |
30 | Quelldateien
31 |
32 |
33 | Quelldateien
34 |
35 |
36 | Quelldateien
37 |
38 |
39 | Quelldateien
40 |
41 |
42 |
43 |
44 | pch
45 |
46 |
47 | Quelldateien
48 |
49 |
50 | Quelldateien
51 |
52 |
53 |
--------------------------------------------------------------------------------
/3fd/opencl/CL/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2015 The Khronos Group Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a
4 | copy of this software and/or associated documentation files (the
5 | "Materials"), to deal in the Materials without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Materials, and to
8 | permit persons to whom the Materials are furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included
12 | in all copies or substantial portions of the Materials.
13 |
14 | MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
15 | KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
16 | SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
17 | https://www.khronos.org/registry/
18 |
19 | THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
23 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 | MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
26 |
--------------------------------------------------------------------------------
/3fd/opencl/CL/cl_gl_ext.h:
--------------------------------------------------------------------------------
1 | /**********************************************************************************
2 | * Copyright (c) 2008-2019 The Khronos Group Inc.
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and/or associated documentation files (the
6 | * "Materials"), to deal in the Materials without restriction, including
7 | * without limitation the rights to use, copy, modify, merge, publish,
8 | * distribute, sublicense, and/or sell copies of the Materials, and to
9 | * permit persons to whom the Materials are furnished to do so, subject to
10 | * the following conditions:
11 | *
12 | * The above copyright notice and this permission notice shall be included
13 | * in all copies or substantial portions of the Materials.
14 | *
15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18 | * https://www.khronos.org/registry/
19 | *
20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27 | **********************************************************************************/
28 |
29 | #ifndef __OPENCL_CL_GL_EXT_H
30 | #define __OPENCL_CL_GL_EXT_H
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif
35 |
36 | #include <3fd/opencl/CL/cl_gl.h>
37 |
38 | /*
39 | * cl_khr_gl_event extension
40 | */
41 | #define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D
42 |
43 | extern CL_API_ENTRY cl_event CL_API_CALL
44 | clCreateEventFromGLsyncKHR(cl_context context,
45 | cl_GLsync cl_GLsync,
46 | cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1;
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 |
52 | #endif /* __OPENCL_CL_GL_EXT_H */
53 |
--------------------------------------------------------------------------------
/3fd/opencl/CL/cl_version.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2018 The Khronos Group Inc.
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and/or associated documentation files (the
6 | * "Materials"), to deal in the Materials without restriction, including
7 | * without limitation the rights to use, copy, modify, merge, publish,
8 | * distribute, sublicense, and/or sell copies of the Materials, and to
9 | * permit persons to whom the Materials are furnished to do so, subject to
10 | * the following conditions:
11 | *
12 | * The above copyright notice and this permission notice shall be included
13 | * in all copies or substantial portions of the Materials.
14 | *
15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18 | * https://www.khronos.org/registry/
19 | *
20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27 | ******************************************************************************/
28 |
29 | #ifndef __CL_VERSION_H
30 | #define __CL_VERSION_H
31 |
32 | /* Detect which version to target */
33 | #if !defined(CL_TARGET_OPENCL_VERSION)
34 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")
35 | #define CL_TARGET_OPENCL_VERSION 220
36 | #endif
37 | #if CL_TARGET_OPENCL_VERSION != 100 && \
38 | CL_TARGET_OPENCL_VERSION != 110 && \
39 | CL_TARGET_OPENCL_VERSION != 120 && \
40 | CL_TARGET_OPENCL_VERSION != 200 && \
41 | CL_TARGET_OPENCL_VERSION != 210 && \
42 | CL_TARGET_OPENCL_VERSION != 220
43 | #pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220). Defaulting to 220 (OpenCL 2.2)")
44 | #undef CL_TARGET_OPENCL_VERSION
45 | #define CL_TARGET_OPENCL_VERSION 220
46 | #endif
47 |
48 |
49 | /* OpenCL Version */
50 | #if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2)
51 | #define CL_VERSION_2_2 1
52 | #endif
53 | #if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1)
54 | #define CL_VERSION_2_1 1
55 | #endif
56 | #if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0)
57 | #define CL_VERSION_2_0 1
58 | #endif
59 | #if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2)
60 | #define CL_VERSION_1_2 1
61 | #endif
62 | #if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1)
63 | #define CL_VERSION_1_1 1
64 | #endif
65 | #if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0)
66 | #define CL_VERSION_1_0 1
67 | #endif
68 |
69 | /* Allow deprecated APIs for older OpenCL versions. */
70 | #if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS)
71 | #define CL_USE_DEPRECATED_OPENCL_2_1_APIS
72 | #endif
73 | #if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS)
74 | #define CL_USE_DEPRECATED_OPENCL_2_0_APIS
75 | #endif
76 | #if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS)
77 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS
78 | #endif
79 | #if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS)
80 | #define CL_USE_DEPRECATED_OPENCL_1_1_APIS
81 | #endif
82 | #if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS)
83 | #define CL_USE_DEPRECATED_OPENCL_1_0_APIS
84 | #endif
85 |
86 | #endif /* __CL_VERSION_H */
87 |
--------------------------------------------------------------------------------
/3fd/opencl/CL/opencl.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2008-2015 The Khronos Group Inc.
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and/or associated documentation files (the
6 | * "Materials"), to deal in the Materials without restriction, including
7 | * without limitation the rights to use, copy, modify, merge, publish,
8 | * distribute, sublicense, and/or sell copies of the Materials, and to
9 | * permit persons to whom the Materials are furnished to do so, subject to
10 | * the following conditions:
11 | *
12 | * The above copyright notice and this permission notice shall be included
13 | * in all copies or substantial portions of the Materials.
14 | *
15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18 | * https://www.khronos.org/registry/
19 | *
20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27 | ******************************************************************************/
28 |
29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
30 |
31 | #ifndef __OPENCL_H
32 | #define __OPENCL_H
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include <3fd/opencl/CL/cl.h>
39 | #include <3fd/opencl/CL/cl_gl.h>
40 | #include <3fd/opencl/CL/cl_gl_ext.h>
41 | #include <3fd/opencl/CL/cl_ext.h>
42 |
43 | #ifdef __cplusplus
44 | }
45 | #endif
46 |
47 | #endif /* __OPENCL_H */
48 |
--------------------------------------------------------------------------------
/3fd/opencl/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10)
2 |
3 | project(3fd-opencl)
4 |
5 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
6 |
7 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
8 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-show-template-tree -fno-elide-type")
9 | elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
10 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
11 | endif()
12 |
13 | #####################
14 | # Macro definitions:
15 |
16 | add_definitions(
17 | -DENABLE_3FD_CST
18 | -DENABLE_3FD_ERR_IMPL_DETAILS
19 | )
20 |
21 | # NDEBUG when release mode:
22 | string(TOLOWER ${CMAKE_BUILD_TYPE} buildType)
23 | if(buildType STREQUAL release)
24 | add_definitions(-DNDEBUG)
25 | endif()
26 |
27 | ########################
28 | # Include directories:
29 |
30 | include_directories(
31 | "${PROJECT_SOURCE_DIR}"
32 | "${PROJECT_SOURCE_DIR}/../../"
33 | )
34 |
35 | ########################
36 | # Dependency libraries:
37 |
38 | # Static library source files:
39 | add_library(3fd-opencl STATIC
40 | opencl_impl.cpp
41 | opencl_impl_commandtracker.cpp
42 | opencl_impl_context.cpp
43 | opencl_impl_device.cpp
44 | opencl_impl_platform.cpp
45 | opencl_impl_program.cpp
46 | opencl_impl_programmanifest.cpp
47 | )
48 |
49 | ################
50 | # Installation:
51 |
52 | install(
53 | TARGETS 3fd-opencl
54 | DESTINATION "${PROJECT_SOURCE_DIR}/../../build/lib"
55 | )
--------------------------------------------------------------------------------
/3fd/opencl/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht
2 |
3 | #include "pch.h"
4 |
5 | // Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich.
6 |
--------------------------------------------------------------------------------
/3fd/opencl/pch.h:
--------------------------------------------------------------------------------
1 | #include <3fd/core/pch.h>
--------------------------------------------------------------------------------
/3fd/rpc/3fd-rpc.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {51c7c546-e38f-4e32-9846-00e29d0d6540}
10 |
11 |
12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
14 |
15 |
16 |
17 |
18 | pch
19 |
20 |
21 | Quelldateien
22 |
23 |
24 | Quelldateien
25 |
26 |
27 | Quelldateien
28 |
29 |
30 |
31 |
32 | pch
33 |
34 |
35 | Quelldateien
36 |
37 |
38 | Quelldateien
39 |
40 |
41 | Quelldateien
42 |
43 |
44 |
--------------------------------------------------------------------------------
/3fd/rpc/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht
2 |
3 | #include "pch.h"
4 |
5 | // Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich.
6 |
--------------------------------------------------------------------------------
/3fd/rpc/pch.h:
--------------------------------------------------------------------------------
1 | #include <3fd/core/pch.h>
--------------------------------------------------------------------------------
/3fd/rpc/rpc_impl_server.h:
--------------------------------------------------------------------------------
1 | #ifndef RPC_IMPL_H // header guard
2 | #define RPC_IMPL_H
3 |
4 | #include "rpc_helpers.h"
5 | #include "rpc_impl_util.h"
6 | #include