├── .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 7 | 8 | namespace _3fd 9 | { 10 | namespace rpc 11 | { 12 | /// 13 | /// Private implementation of class. 14 | /// 15 | class RpcServerImpl 16 | { 17 | private: 18 | 19 | RPC_BINDING_VECTOR *m_bindings; 20 | 21 | std::map m_regObjsByIntfHnd; 22 | 23 | std::wstring m_serviceName; 24 | 25 | std::unique_ptr m_sysCertStore; 26 | std::unique_ptr m_schannelCred; 27 | 28 | AuthenticationLevel m_cliReqAuthnLevel; 29 | bool m_hasAuthnSec; 30 | 31 | /// 32 | /// Enumerates the possible states for the RPC server. 33 | /// 34 | enum class State 35 | { 36 | NotInitialized, // initial state: not fully instantiated 37 | BindingsAcquired, // bindings acquired for dynamic endpoints & authentication service set 38 | IntfRegRuntimeLib, // interfaces registered with RPC runtime library 39 | IntfRegLocalEndptMap, // interfaces registered in the local endpoint-map database 40 | Listening // server is listening 41 | }; 42 | 43 | State m_state; 44 | 45 | void OnStartFailureRollbackIntfReg() noexcept; 46 | 47 | public: 48 | 49 | RpcServerImpl( 50 | ProtocolSequence protSeq, 51 | const string &serviceName, 52 | bool hasAuthnSec 53 | ); 54 | 55 | RpcServerImpl( 56 | ProtocolSequence protSeq, 57 | const string &serviceName, 58 | AuthenticationLevel authnLevel 59 | ); 60 | 61 | RpcServerImpl( 62 | const string &serviceName, 63 | const CertInfo *certInfoX509, 64 | AuthenticationLevel authnLevel 65 | ); 66 | 67 | ~RpcServerImpl(); 68 | 69 | /// 70 | /// Gets the required authentication level. 71 | /// 72 | /// The required authentication level for clients, 73 | /// as defined upon initialization. 74 | AuthenticationLevel GetRequiredAuthnLevel() const { return m_cliReqAuthnLevel; } 75 | 76 | bool Start(const std::vector &objects); 77 | 78 | bool Stop(); 79 | 80 | bool Resume(); 81 | 82 | bool Wait(); 83 | }; 84 | 85 | }// end of namespace rpc 86 | }// end of namespace _3fd 87 | 88 | #endif // end of header guard 89 | -------------------------------------------------------------------------------- /3fd/sqlite/3fd-sqlite-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 | {f764b1fa-3001-4662-82c1-ed685d526d63} 10 | 11 | 12 | 13 | 14 | pch 15 | 16 | 17 | 18 | pch 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | pch 28 | 29 | 30 | -------------------------------------------------------------------------------- /3fd/sqlite/3fd-sqlite.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 | {0a548904-258a-45cc-a93f-4c5b84609e31} 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 | 34 | 35 | pch 36 | 37 | 38 | Quelldateien 39 | 40 | 41 | -------------------------------------------------------------------------------- /3fd/sqlite/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(3fd-sqlite) 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-sqlite STATIC 40 | sqlite_databaseconn.cpp 41 | sqlite_dbconnpool.cpp 42 | sqlite_prepstatement.cpp 43 | sqlite_transaction.cpp 44 | ) 45 | 46 | ################ 47 | # Installation: 48 | 49 | install( 50 | TARGETS 3fd-sqlite 51 | DESTINATION "${PROJECT_SOURCE_DIR}/../../build/lib" 52 | ) -------------------------------------------------------------------------------- /3fd/sqlite/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/sqlite/pch.h: -------------------------------------------------------------------------------- 1 | #include "3fd/core/pch.h" -------------------------------------------------------------------------------- /3fd/sqlite/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/utils/3fd-utils-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 | {80b1e6f6-8c9a-48f2-83a3-faa2466963df} 10 | 11 | 12 | 13 | 14 | pch 15 | 16 | 17 | pch 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | pch 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /3fd/utils/3fd-utils.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 | {b2cdb2e9-7b2f-4a18-89a5-f53580d9aa14} 14 | 15 | 16 | 17 | 18 | Quelldateien 19 | 20 | 21 | Quelldateien 22 | 23 | 24 | pch 25 | 26 | 27 | Quelldateien 28 | 29 | 30 | Quelldateien 31 | 32 | 33 | Quelldateien 34 | 35 | 36 | Quelldateien 37 | 38 | 39 | Quelldateien 40 | 41 | 42 | Quelldateien 43 | 44 | 45 | Quelldateien 46 | 47 | 48 | 49 | 50 | Quelldateien 51 | 52 | 53 | Quelldateien 54 | 55 | 56 | pch 57 | 58 | 59 | Quelldateien 60 | 61 | 62 | Quelldateien 63 | 64 | 65 | Quelldateien 66 | 67 | 68 | Quelldateien 69 | 70 | 71 | Quelldateien 72 | 73 | 74 | Quelldateien 75 | 76 | 77 | -------------------------------------------------------------------------------- /3fd/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(3fd-utils) 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-utils STATIC 40 | asynchronous.cpp 41 | cmdline.cpp 42 | dynmempool.cpp 43 | event.cpp 44 | memorypool.cpp 45 | serialization.cpp 46 | text.cpp 47 | xml.cpp 48 | ) 49 | 50 | ################ 51 | # Installation: 52 | 53 | install( 54 | TARGETS 3fd-utils 55 | DESTINATION "${PROJECT_SOURCE_DIR}/../../build/lib" 56 | ) -------------------------------------------------------------------------------- /3fd/utils/asynchronous.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 "concurrency.h" 8 | #include <3fd/core/exceptions.h> 9 | #include <3fd/core/logger.h> 10 | 11 | #include 12 | #include 13 | 14 | namespace _3fd 15 | { 16 | namespace utils 17 | { 18 | /// 19 | /// Invokes a callback asynchronously and leaves without waiting for termination. 20 | /// 21 | /// The callback. 22 | void Asynchronous::InvokeAndLeave(const std::function &callback) 23 | { 24 | CALL_STACK_TRACE; 25 | 26 | try 27 | { 28 | // Launch asynchronous execution of callback and then a little housekeeping: 29 | std::thread thread([callback]() 30 | { 31 | try 32 | { 33 | callback(); // invoke the callback 34 | } 35 | catch (core::IAppException &ex) 36 | { 37 | core::Logger::Write(ex, core::Logger::PRIO_ERROR); 38 | } 39 | catch (std::exception &ex) 40 | { 41 | std::ostringstream oss; 42 | oss << "Generic failure when executing callback asynchronously: " << ex.what(); 43 | core::Logger::Write(oss.str(), core::Logger::PRIO_ERROR); 44 | } 45 | catch (...) 46 | { 47 | std::ostringstream oss; 48 | oss << "Unexpected exception during asynchronous execution of callback"; 49 | core::Logger::Write(oss.str(), core::Logger::PRIO_ERROR); 50 | } 51 | }); 52 | 53 | thread.detach(); 54 | } 55 | catch (std::system_error &ex) 56 | { 57 | std::ostringstream oss; 58 | oss << "System failure when starting new asynchronous execution: " << core::StdLibExt::GetDetailsFromSystemError(ex); 59 | throw core::AppException(oss.str()); 60 | } 61 | catch (std::exception &ex) 62 | { 63 | std::ostringstream oss; 64 | oss << "Generic failure when starting new asynchronous execution: " << ex.what(); 65 | throw core::AppException(oss.str()); 66 | } 67 | } 68 | 69 | } // end of namespace utils 70 | } // end of namespace _3fd 71 | -------------------------------------------------------------------------------- /3fd/utils/event.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 "concurrency.h" 8 | #include <3fd/core/exceptions.h> 9 | 10 | #include 11 | #include 12 | 13 | namespace _3fd 14 | { 15 | namespace utils 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | Event::Event() 21 | try: 22 | m_mutex(), // might throw an exception 23 | m_condition(), // might throw an exception 24 | m_flag(false) 25 | { 26 | } 27 | catch(std::system_error &ex) 28 | { 29 | std::ostringstream oss; 30 | oss << "Failed to create an event for thread synchronization: " << core::StdLibExt::GetDetailsFromSystemError(ex); 31 | throw core::AppException(oss.str()); 32 | } 33 | 34 | /// 35 | /// Sets the event. 36 | /// This will wake only a single listener! 37 | /// 38 | void Event::Signalize() 39 | { 40 | {// sets a flag that is later checked for signal confirmation 41 | std::lock_guard lock(m_mutex); 42 | m_flag = true; 43 | } 44 | m_condition.notify_one(); 45 | } 46 | 47 | /// 48 | /// Wait for the event to be set along with an approval from the predicate. 49 | /// The predicate might not approve the context if, for example, the event was set before the 50 | /// callee starts to wait, and by the time the callee is made aware of the previous notification, 51 | /// the context has already changed and this previous notification is no longer valid. 52 | /// 53 | /// The predicate that approves the context. 54 | void Event::Wait(const std::function &predicate) 55 | { 56 | std::unique_lock lock(m_mutex); 57 | 58 | m_condition.wait(lock, [this, &predicate]() 59 | { 60 | if (m_flag) 61 | { 62 | m_flag = false; 63 | return predicate(); 64 | } 65 | else // spurius wake-up? 66 | return false; 67 | }); 68 | } 69 | 70 | /// 71 | /// Wait for the event to be set or a timeout. 72 | /// 73 | /// The timeout in milliseconds. 74 | /// 'true' if the event was set, 'false' if a timeout happens first. 75 | bool Event::WaitFor(unsigned long millisecs) 76 | { 77 | std::unique_lock lock(m_mutex); 78 | 79 | return m_flag || 80 | m_condition.wait_for(lock, 81 | std::chrono::milliseconds(millisecs), 82 | [this]() 83 | { 84 | if (m_flag) 85 | { 86 | m_flag = false; 87 | return true; 88 | } 89 | 90 | return false; 91 | }); 92 | } 93 | 94 | } // end of namespace utils 95 | } // end of namespace _3fd 96 | -------------------------------------------------------------------------------- /3fd/utils/pch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/3fd/utils/pch.cpp -------------------------------------------------------------------------------- /3fd/utils/pch.h: -------------------------------------------------------------------------------- 1 | #include "3fd/core/pch.h" -------------------------------------------------------------------------------- /3fd/utils/serialization.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 "serialization.h" 8 | #include 9 | 10 | namespace _3fd 11 | { 12 | namespace utils 13 | { 14 | /////////////////////////////////////// 15 | // Specialization of serializations 16 | /////////////////////////////////////// 17 | 18 | size_t _estimate_string_size() 19 | { 20 | return 0; 21 | } 22 | 23 | #ifdef _3FD_PLATFORM_WINRT 24 | 25 | SerializableValue FormatArg(const winrt::hstring &value) 26 | { 27 | return SerializableValue(value.c_str()); 28 | } 29 | #endif 30 | 31 | } // end of namespace utils 32 | } // end of namespace _3fd -------------------------------------------------------------------------------- /3fd/utils/sharedmutex.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 "concurrency.h" 8 | #include 9 | 10 | namespace _3fd 11 | { 12 | namespace utils 13 | { 14 | //////////////////////////////////// 15 | // shared_mutex Class 16 | //////////////////////////////////// 17 | 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | shared_mutex::shared_mutex() 22 | : m_curLockType(None) 23 | { 24 | InitializeSRWLock(&m_srwLockHandle); 25 | } 26 | 27 | /// 28 | /// Finalizes an instance of the class. 29 | /// 30 | shared_mutex::~shared_mutex() 31 | { 32 | switch (m_curLockType) 33 | { 34 | case _3fd::utils::shared_mutex::Shared: 35 | unlock_shared(); 36 | break; 37 | 38 | case _3fd::utils::shared_mutex::Exclusive: 39 | unlock(); 40 | break; 41 | 42 | default: 43 | break; 44 | } 45 | } 46 | 47 | /// 48 | /// Acquires a shared lock. 49 | /// 50 | void shared_mutex::lock_shared() 51 | { 52 | AcquireSRWLockShared(&m_srwLockHandle); 53 | m_curLockType = Shared; 54 | } 55 | 56 | /// 57 | /// Releases a shared lock. 58 | /// 59 | void shared_mutex::unlock_shared() 60 | { 61 | _ASSERTE(m_curLockType == Shared); // cannot release a lock that was not previously acquired 62 | ReleaseSRWLockShared(&m_srwLockHandle); 63 | m_curLockType = None; 64 | } 65 | 66 | /// 67 | /// Acquires an exclusive lock 68 | /// 69 | void shared_mutex::lock() 70 | { 71 | AcquireSRWLockExclusive(&m_srwLockHandle); 72 | m_curLockType = Exclusive; 73 | } 74 | 75 | /// 76 | /// Releases the exclusive lock. 77 | /// 78 | void shared_mutex::unlock() 79 | { 80 | _ASSERTE(m_curLockType == Exclusive); // cannot release a lock that was not previously acquired 81 | ReleaseSRWLockExclusive(&m_srwLockHandle); 82 | m_curLockType = None; 83 | } 84 | 85 | } // end of namespace utils 86 | } // end of namespace _3fd 87 | -------------------------------------------------------------------------------- /3fd/utils/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/utils/text.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 "text.h" 8 | #include 9 | #include 10 | 11 | namespace _3fd 12 | { 13 | namespace utils 14 | { 15 | std::string to_lower(std::string str) 16 | { 17 | for (char &ch : str) 18 | { 19 | ch = tolower(ch); 20 | } 21 | 22 | return str; 23 | } 24 | 25 | std::string to_upper(std::string str) 26 | { 27 | for (char &ch : str) 28 | { 29 | ch = toupper(ch); 30 | } 31 | 32 | return str; 33 | } 34 | 35 | //////////////////////////////////////////////// 36 | // Unicode Conversion 37 | //////////////////////////////////////////////// 38 | 39 | std::wstring to_ucs2(std::string_view input) 40 | { 41 | if (!input.empty()) 42 | { 43 | std::wstring_convert> transcoder; 44 | return transcoder.from_bytes(input.data(), input.data() + input.length()); 45 | } 46 | 47 | return std::wstring(); 48 | } 49 | 50 | std::string to_utf8(std::wstring_view input) 51 | { 52 | if (!input.empty()) 53 | { 54 | std::wstring_convert> transcoder; 55 | return transcoder.to_bytes(input.data(), input.data() + input.length()); 56 | } 57 | 58 | return std::string(); 59 | } 60 | 61 | }// end of namespace utils 62 | }// end of namespace _3fd 63 | -------------------------------------------------------------------------------- /3fd/wws/3fd-wws.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 | {93e3d0be-ecf8-4b2d-bc81-2aeaa6a68514} 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 | 40 | 41 | pch 42 | 43 | 44 | Quelldateien 45 | 46 | 47 | Quelldateien 48 | 49 | 50 | Quelldateien 51 | 52 | 53 | Quelldateien 54 | 55 | 56 | Quelldateien 57 | 58 | 59 | 60 | 61 | Ressourcendateien 62 | 63 | 64 | -------------------------------------------------------------------------------- /3fd/wws/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/wws/pch.h: -------------------------------------------------------------------------------- 1 | #include <3fd/core/pch.h> -------------------------------------------------------------------------------- /3fd/wws/proxy_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef WEB_WWS_PROXY_IMPL_H // header guard 2 | #define WEB_WWS_PROXY_IMPL_H 3 | 4 | #include "webserviceproxy.h" 5 | #include "utils_impl.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace _3fd 12 | { 13 | namespace web 14 | { 15 | namespace wws 16 | { 17 | /// 18 | /// Represents a proxy for a running web service host. 19 | /// 20 | class WebServiceProxyImpl 21 | { 22 | private: 23 | 24 | WS_SERVICE_PROXY *m_wsSvcProxyHandle; 25 | 26 | std::wstring m_svcEndptAddr; 27 | 28 | std::mutex m_proxyStateMutex; 29 | 30 | std::atomic m_isOnHold; 31 | 32 | WSHeap m_heap; 33 | 34 | std::vector *> m_promises; 35 | 36 | public: 37 | 38 | WebServiceProxyImpl( 39 | const string &svcEndpointAddress, 40 | const SvcProxyConfig &config, 41 | CallbackWrapperCreateServiceProxy callback 42 | ); 43 | 44 | WebServiceProxyImpl( 45 | const string &svcEndpointAddress, 46 | const SvcProxyConfig &config, 47 | const SvcProxyCertInfo &certInfo, 48 | CallbackCreateServiceProxyImpl callback 49 | ); 50 | 51 | WebServiceProxyImpl( 52 | const string &svcEndpointAddress, 53 | const SvcProxyConfig &config, 54 | const SvcProxyCertInfo &certInfo, 55 | CallbackCreateServiceProxyImpl callback 56 | ); 57 | 58 | WebServiceProxyImpl(const WebServiceProxyImpl &) = delete; 59 | 60 | ~WebServiceProxyImpl(); 61 | 62 | /// 63 | /// Gets the handle for this web service proxy. 64 | /// 65 | /// A handle for this web service proxy. 66 | WS_SERVICE_PROXY *GetHandle() const { return m_wsSvcProxyHandle; } 67 | 68 | bool Open(); 69 | bool Close(); 70 | bool Abort(); 71 | 72 | void Call(const char *operLabel, 73 | size_t operHeapSize, 74 | const WsCallWrap &operWrap); 75 | }; 76 | 77 | }// end of namespace wws 78 | }// end of namespace web 79 | }// end of namespace _3fd 80 | 81 | #endif // end of header guard 82 | -------------------------------------------------------------------------------- /3fd/wws/utils_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef WEB_WWS_UTILS_IMPL_H // header guard 2 | #define WEB_WWS_UTILS_IMPL_H 3 | 4 | #include "utils.h" 5 | 6 | namespace _3fd 7 | { 8 | using std::string; 9 | 10 | namespace web 11 | { 12 | namespace wws 13 | { 14 | /////////////////////////// 15 | // String manipulation 16 | /////////////////////////// 17 | 18 | WS_XML_STRING ToWsXmlString(const string &str); 19 | 20 | WS_XML_STRING *ToWsXmlString(const string &str, WSHeap &heap); 21 | 22 | WS_STRING ToWsString(const std::string_view &str, WSHeap &heap); 23 | 24 | WS_STRING ToWsString(const std::wstring_view &str, WSHeap &heap); 25 | 26 | 27 | ////////////////////// 28 | // XML Handling 29 | ////////////////////// 30 | 31 | extern const WS_XML_STRING faultDetailDescElemNamespace; 32 | 33 | extern const WS_XML_STRING faultDetailDescElemLocalName; 34 | 35 | WS_FAULT_DETAIL_DESCRIPTION GetFaultDetailDescription(WSHeap &heap); 36 | 37 | 38 | /// 39 | /// A wrapper for WS_XML_WRITER. 40 | /// 41 | class WSXmlWriter 42 | { 43 | private: 44 | 45 | WS_XML_WRITER *m_wsXmlWriterHandle; 46 | 47 | public: 48 | 49 | WSXmlWriter(WS_XML_BUFFER *wsXmlBufferHandle); 50 | 51 | ~WSXmlWriter(); 52 | 53 | /// 54 | /// Initializes a new instance of the class using move semantics. 55 | /// 56 | /// The object whose resources will be stolen from. 57 | WSXmlWriter(WSXmlWriter &&ob) noexcept 58 | : m_wsXmlWriterHandle(ob.m_wsXmlWriterHandle) 59 | { 60 | ob.m_wsXmlWriterHandle = nullptr; 61 | } 62 | 63 | WSXmlWriter(const WSXmlWriter &) = delete; 64 | 65 | void WriteStartElement( 66 | const WS_XML_STRING &ns, 67 | const WS_XML_STRING &localName); 68 | 69 | void WriteEndElement(); 70 | 71 | void WriteText(const string &content); 72 | }; 73 | 74 | 75 | /// 76 | /// A wrapper for WS_XML_READER. 77 | /// 78 | class WSXmlReader 79 | { 80 | private: 81 | 82 | WS_XML_READER *m_wsXmlReaderHandle; 83 | 84 | public: 85 | 86 | WSXmlReader(WS_XML_BUFFER *wsXmlBufferHandle); 87 | 88 | ~WSXmlReader(); 89 | 90 | /// 91 | /// Initializes a new instance of the class 92 | /// using move semantics. 93 | /// 94 | /// The object whose resources will be stolen. 95 | WSXmlReader(WSXmlReader &&ob) noexcept 96 | : m_wsXmlReaderHandle(ob.m_wsXmlReaderHandle) 97 | { 98 | ob.m_wsXmlReaderHandle = nullptr; 99 | } 100 | 101 | WSXmlReader(const WSXmlReader &) = delete; 102 | 103 | void ReadStartElement( 104 | const WS_XML_STRING &ns, 105 | const WS_XML_STRING &localName); 106 | 107 | void ReadEndElement(); 108 | 109 | void ReadText(std::vector &utf8text); 110 | }; 111 | 112 | }// end of namespace wws 113 | }// end of namespace web 114 | }// end of namespace _3fd 115 | 116 | #endif // end of header guard 117 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(3fd) 4 | 5 | add_subdirectory(gtest) 6 | add_subdirectory(nanodbc) 7 | add_subdirectory(sqlite3) 8 | 9 | add_subdirectory(3fd/core) 10 | add_subdirectory(3fd/utils) 11 | add_subdirectory(3fd/sqlite) 12 | add_subdirectory(3fd/broker) 13 | add_subdirectory(3fd/opencl) 14 | 15 | add_subdirectory(UnitTests) 16 | add_subdirectory(IntegrationTests) -------------------------------------------------------------------------------- /IntegrationTests/AcmeTesting_w32.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */ 4 | 5 | 6 | /* File created by MIDL compiler version 8.01.0620 */ 7 | /* at Tue Jan 19 01:14:07 2038 8 | */ 9 | /* Compiler settings for TestShared\AcmeTesting.idl: 10 | Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0620 11 | protocol : dce , ms_ext, c_ext, robust 12 | error checks: allocation ref bounds_check enum stub_data , use_epv 13 | VC __declspec() decoration level: 14 | __declspec(uuid()), __declspec(selectany), __declspec(novtable) 15 | DECLSPEC_UUID(), MIDL_INTERFACE() 16 | */ 17 | /* @@MIDL_FILE_HEADING( ) */ 18 | 19 | #pragma warning( disable: 4049 ) /* more than 64k source lines */ 20 | 21 | 22 | /* verify that the version is high enough to compile this file*/ 23 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 24 | #define __REQUIRED_RPCNDR_H_VERSION__ 475 25 | #endif 26 | 27 | #include "rpc.h" 28 | #include "rpcndr.h" 29 | 30 | #ifndef __RPCNDR_H_VERSION__ 31 | #error this stub requires an updated version of 32 | #endif /* __RPCNDR_H_VERSION__ */ 33 | 34 | 35 | #ifndef __AcmeTesting_w32_h__ 36 | #define __AcmeTesting_w32_h__ 37 | 38 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 39 | #pragma once 40 | #endif 41 | 42 | /* Forward Declarations */ 43 | 44 | #ifdef __cplusplus 45 | extern "C"{ 46 | #endif 47 | 48 | 49 | #ifndef __AcmeTesting_INTERFACE_DEFINED__ 50 | #define __AcmeTesting_INTERFACE_DEFINED__ 51 | 52 | /* interface AcmeTesting */ 53 | /* [version][uuid] */ 54 | 55 | typedef struct pair 56 | { 57 | int left; 58 | int right; 59 | } pair; 60 | 61 | void Invert( 62 | /* [in] */ handle_t IDL_handle, 63 | /* [out][in] */ pair *onePair); 64 | 65 | void Operate( 66 | /* [in] */ handle_t IDL_handle, 67 | /* [in] */ double left, 68 | /* [in] */ double right, 69 | /* [out] */ double *result); 70 | 71 | void ChangeCase( 72 | /* [in] */ handle_t IDL_handle, 73 | /* [string][in] */ unsigned char *input, 74 | /* [size_is][string][out] */ unsigned char *output); 75 | 76 | void WriteOnStorage( 77 | /* [in] */ handle_t IDL_handle); 78 | 79 | unsigned long Shutdown( 80 | /* [in] */ handle_t IDL_handle); 81 | 82 | 83 | 84 | typedef struct _AcmeTesting_v1_0_epv_t 85 | { 86 | void ( *Invert )( 87 | /* [in] */ handle_t IDL_handle, 88 | /* [out][in] */ pair *onePair); 89 | void ( *Operate )( 90 | /* [in] */ handle_t IDL_handle, 91 | /* [in] */ double left, 92 | /* [in] */ double right, 93 | /* [out] */ double *result); 94 | void ( *ChangeCase )( 95 | /* [in] */ handle_t IDL_handle, 96 | /* [string][in] */ unsigned char *input, 97 | /* [size_is][string][out] */ unsigned char *output); 98 | void ( *WriteOnStorage )( 99 | /* [in] */ handle_t IDL_handle); 100 | unsigned long ( *Shutdown )( 101 | /* [in] */ handle_t IDL_handle); 102 | 103 | } AcmeTesting_v1_0_epv_t; 104 | 105 | extern RPC_IF_HANDLE AcmeTesting_v1_0_c_ifspec; 106 | extern RPC_IF_HANDLE AcmeTesting_v1_0_s_ifspec; 107 | #endif /* __AcmeTesting_INTERFACE_DEFINED__ */ 108 | 109 | /* Additional Prototypes for ALL interfaces */ 110 | 111 | /* end of Additional Prototypes */ 112 | 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | 117 | #endif 118 | 119 | 120 | -------------------------------------------------------------------------------- /IntegrationTests/AcmeTesting_x64.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */ 4 | 5 | 6 | /* File created by MIDL compiler version 8.01.0620 */ 7 | /* at Tue Jan 19 01:14:07 2038 8 | */ 9 | /* Compiler settings for TestShared\AcmeTesting.idl: 10 | Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0620 11 | protocol : dce , ms_ext, c_ext, robust 12 | error checks: allocation ref bounds_check enum stub_data , use_epv 13 | VC __declspec() decoration level: 14 | __declspec(uuid()), __declspec(selectany), __declspec(novtable) 15 | DECLSPEC_UUID(), MIDL_INTERFACE() 16 | */ 17 | /* @@MIDL_FILE_HEADING( ) */ 18 | 19 | #pragma warning( disable: 4049 ) /* more than 64k source lines */ 20 | 21 | 22 | /* verify that the version is high enough to compile this file*/ 23 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 24 | #define __REQUIRED_RPCNDR_H_VERSION__ 475 25 | #endif 26 | 27 | #include "rpc.h" 28 | #include "rpcndr.h" 29 | 30 | #ifndef __RPCNDR_H_VERSION__ 31 | #error this stub requires an updated version of 32 | #endif /* __RPCNDR_H_VERSION__ */ 33 | 34 | 35 | #ifndef __AcmeTesting_x64_h__ 36 | #define __AcmeTesting_x64_h__ 37 | 38 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 39 | #pragma once 40 | #endif 41 | 42 | /* Forward Declarations */ 43 | 44 | #ifdef __cplusplus 45 | extern "C"{ 46 | #endif 47 | 48 | 49 | #ifndef __AcmeTesting_INTERFACE_DEFINED__ 50 | #define __AcmeTesting_INTERFACE_DEFINED__ 51 | 52 | /* interface AcmeTesting */ 53 | /* [version][uuid] */ 54 | 55 | typedef struct pair 56 | { 57 | int left; 58 | int right; 59 | } pair; 60 | 61 | void Invert( 62 | /* [in] */ handle_t IDL_handle, 63 | /* [out][in] */ pair *onePair); 64 | 65 | void Operate( 66 | /* [in] */ handle_t IDL_handle, 67 | /* [in] */ double left, 68 | /* [in] */ double right, 69 | /* [out] */ double *result); 70 | 71 | void ChangeCase( 72 | /* [in] */ handle_t IDL_handle, 73 | /* [string][in] */ unsigned char *input, 74 | /* [size_is][string][out] */ unsigned char *output); 75 | 76 | void WriteOnStorage( 77 | /* [in] */ handle_t IDL_handle); 78 | 79 | unsigned long Shutdown( 80 | /* [in] */ handle_t IDL_handle); 81 | 82 | 83 | 84 | typedef struct _AcmeTesting_v1_0_epv_t 85 | { 86 | void ( *Invert )( 87 | /* [in] */ handle_t IDL_handle, 88 | /* [out][in] */ pair *onePair); 89 | void ( *Operate )( 90 | /* [in] */ handle_t IDL_handle, 91 | /* [in] */ double left, 92 | /* [in] */ double right, 93 | /* [out] */ double *result); 94 | void ( *ChangeCase )( 95 | /* [in] */ handle_t IDL_handle, 96 | /* [string][in] */ unsigned char *input, 97 | /* [size_is][string][out] */ unsigned char *output); 98 | void ( *WriteOnStorage )( 99 | /* [in] */ handle_t IDL_handle); 100 | unsigned long ( *Shutdown )( 101 | /* [in] */ handle_t IDL_handle); 102 | 103 | } AcmeTesting_v1_0_epv_t; 104 | 105 | extern RPC_IF_HANDLE AcmeTesting_v1_0_c_ifspec; 106 | extern RPC_IF_HANDLE AcmeTesting_v1_0_s_ifspec; 107 | #endif /* __AcmeTesting_INTERFACE_DEFINED__ */ 108 | 109 | /* Additional Prototypes for ALL interfaces */ 110 | 111 | /* end of Additional Prototypes */ 112 | 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | 117 | #endif 118 | 119 | 120 | -------------------------------------------------------------------------------- /IntegrationTests/CreateMsSqlSvcBrokerDB.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/CreateMsSqlSvcBrokerDB.sql -------------------------------------------------------------------------------- /IntegrationTests/IntegrationTests.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;tiff;tif;png;wav;mfcribbon-ms 7 | 8 | 9 | {3cdbf7c7-8662-45f4-b286-7a9c1e6a89c1} 10 | 11 | 12 | {969f7b54-2428-4044-982d-0f24584eb4c3} 13 | 14 | 15 | {e15ca296-1011-4b04-bbcf-dbded3874992} 16 | 17 | 18 | 19 | 20 | Source Files 21 | 22 | 23 | Source Files 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Shared 51 | 52 | 53 | Source Files 54 | 55 | 56 | pch 57 | 58 | 59 | Shared 60 | 61 | 62 | Shared 63 | 64 | 65 | 66 | 67 | Resource Files 68 | 69 | 70 | Resource Files 71 | 72 | 73 | Resource Files 74 | 75 | 76 | 77 | 78 | Shared 79 | 80 | 81 | Source Files 82 | 83 | 84 | Source Files 85 | 86 | 87 | Source Files 88 | 89 | 90 | pch 91 | 92 | 93 | 94 | 95 | Resource Files 96 | 97 | 98 | 99 | 100 | Resource Files 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /IntegrationTests/RestoreSvcBrokerDbForLinux1.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/RestoreSvcBrokerDbForLinux1.sql -------------------------------------------------------------------------------- /IntegrationTests/RestoreSvcBrokerDbForLinux2.sql: -------------------------------------------------------------------------------- 1 | USE[SvcBrokerTest]; 2 | IF NOT EXISTS (SELECT * FROM sys.sql_logins WHERE NAME = N'tester') 3 | BEGIN 4 | CREATE LOGIN [tester] 5 | WITH PASSWORD=N'tester', 6 | DEFAULT_DATABASE=[SvcBrokerTest], 7 | CHECK_EXPIRATION=OFF, 8 | CHECK_POLICY=OFF; 9 | END; 10 | 11 | IF NOT EXISTS (SELECT * FROM sys.sysusers WHERE NAME = N'tester') 12 | BEGIN 13 | CREATE USER [tester] FOR LOGIN [tester]; 14 | END; 15 | 16 | ALTER ROLE [db_datareader] ADD MEMBER [tester]; 17 | ALTER ROLE [db_datawriter] ADD MEMBER [tester]; 18 | ALTER ROLE [db_ddladmin] ADD MEMBER [tester]; 19 | ALTER ROLE [db_owner] ADD MEMBER [tester]; 20 | -------------------------------------------------------------------------------- /IntegrationTests/RestoreSvcBrokerDbForWin.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/RestoreSvcBrokerDbForWin.sql -------------------------------------------------------------------------------- /IntegrationTests/UWP/5f042ca4-a62c-4960-b997-b0ff543d7792.3fd.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /IntegrationTests/UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /IntegrationTests/UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /IntegrationTests/UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /IntegrationTests/UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /IntegrationTests/UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /IntegrationTests/UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /IntegrationTests/UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /IntegrationTests/UWP/IntegrationTestsApp.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 76b6e741-768b-491e-9dbc-8f9c4b2e32c9 6 | 7 | 8 | 6e71148d-0624-48cb-9e78-09a4b4df13d8 9 | bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png 10 | 11 | 12 | {d620ead1-de34-4340-a16d-1d7b4dea8175} 13 | 14 | 15 | {ad7a0528-e0e6-4dce-a42d-e6c6fe72688d} 16 | 17 | 18 | 19 | 20 | Assets 21 | 22 | 23 | Assets 24 | 25 | 26 | Assets 27 | 28 | 29 | Assets 30 | 31 | 32 | Assets 33 | 34 | 35 | Assets 36 | 37 | 38 | Assets 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | Ported 50 | 51 | 52 | Ported 53 | 54 | 55 | Ported 56 | 57 | 58 | Ported 59 | 60 | 61 | pch 62 | 63 | 64 | Common 65 | 66 | 67 | Common 68 | 69 | 70 | 71 | 72 | pch 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /IntegrationTests/UWP/IntegrationTestsApp_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/UWP/IntegrationTestsApp_TemporaryKey.pfx -------------------------------------------------------------------------------- /IntegrationTests/UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | IntegrationTestsApp 21 | felip 22 | Assets\StoreLogo.png 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 42 | 48 | 49 | 50 | 51 | 52 | 53 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /IntegrationTests/application.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 48 | 50 | 51 | 53 | 54 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /IntegrationTests/install_manifest.txt: -------------------------------------------------------------------------------- 1 | /mnt/c/Users/felip/source/repos/3fd/build/bin/IntegrationTests 2 | /mnt/c/Users/felip/source/repos/3fd/build/lib/lib3FDd.a -------------------------------------------------------------------------------- /IntegrationTests/opencl-c-example-wrong.txt: -------------------------------------------------------------------------------- 1 | damaged void saxpy(const __global float * X, 2 | __global float * Y, 3 | const float a) 4 | { 5 | uint gid = get_global_id(0); 6 | Y[gid] = a* X[gid] + Y[gid]; 7 | } 8 | -------------------------------------------------------------------------------- /IntegrationTests/opencl-c-example.txt: -------------------------------------------------------------------------------- 1 | __kernel void transform(__global float *input, 2 | __global float *output) 3 | { 4 | uint gid = get_global_id(0); 5 | 6 | output[gid] = 10 * input[gid]; 7 | } 8 | -------------------------------------------------------------------------------- /IntegrationTests/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 | -------------------------------------------------------------------------------- /IntegrationTests/pch.h: -------------------------------------------------------------------------------- 1 | #include <3fd/core/pch.h> 2 | -------------------------------------------------------------------------------- /IntegrationTests/tests_isam.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/IntegrationTests/tests_isam.cpp -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Microsoft Public License (Ms-PL) 2 | 3 | This license governs use of the accompanying software. If you use the software, 4 | you accept this license. If you do not accept the license, do not use the 5 | software. 6 | 7 | 1. Definitions 8 | 9 | The terms "reproduce," "reproduction," "derivative works," and "distribution" 10 | have the same meaning here as under U.S. copyright law. 11 | 12 | A "contribution" is the original software, or any additions or changes to the 13 | software. 14 | 15 | A "contributor" is any person that distributes its contribution under this 16 | license. 17 | 18 | "Licensed patents" are a contributor's patent claims that read directly on 19 | its contribution. 20 | 21 | 2. Grant of Rights 22 | 23 | (A) Copyright Grant- Subject to the terms of this license, including the 24 | license conditions and limitations in section 3, each contributor grants you 25 | a non-exclusive, worldwide, royalty-free copyright license to reproduce its 26 | contribution, prepare derivative works of its contribution, and distribute 27 | its contribution or any derivative works that you create. 28 | 29 | (B) Patent Grant- Subject to the terms of this license, including the 30 | license conditions and limitations in section 3, each contributor grants you 31 | a non-exclusive, worldwide, royalty-free license under its licensed patents 32 | to make, have made, use, sell, offer for sale, import, and/or otherwise 33 | dispose of its contribution in the software or derivative works of the 34 | contribution in the software. 35 | 36 | 3. Conditions and Limitations 37 | 38 | (A) No Trademark License- This license does not grant you rights to use any 39 | contributors' name, logo, or trademarks. 40 | 41 | (B) If you bring a patent claim against any contributor over patents that you 42 | claim are infringed by the software, your patent license from such contributor 43 | to the software ends automatically. 44 | 45 | (C) If you distribute any portion of the software, you must retain all 46 | copyright, patent, trademark, and attribution notices that are present in the 47 | software. 48 | 49 | (D) If you distribute any portion of the software in source code form, you may 50 | do so only under this license by including a complete copy of this license 51 | with your distribution. If you distribute any portion of the software in 52 | compiled or object code form, you may only do so under a license that complies 53 | with this license. 54 | 55 | (E) The software is licensed "as-is." You bear the risk of using it. The 56 | contributors give no express warranties, guarantees or conditions. You may 57 | have additional consumer rights under your local laws which this license 58 | cannot change. To the extent permitted under your local laws, the contributors 59 | exclude the implied warranties of merchantability, fitness for a particular 60 | purpose and non-infringement. 61 | -------------------------------------------------------------------------------- /MidlCompileRpcTestIDL.bat: -------------------------------------------------------------------------------- 1 | call "%VS140COMNTOOLS%\VsDevCmd.bat" 2 | 3 | midl /Oicf /use_epv /win32 /client none /out IntegrationTests /h AcmeTesting_w32.h /sstub AcmeTesting_w32_srv.c TestShared\AcmeTesting.idl 4 | 5 | midl /Oicf /use_epv /amd64 /client none /out IntegrationTests /h AcmeTesting_x64.h /sstub AcmeTesting_x64_srv.c TestShared\AcmeTesting.idl 6 | 7 | midl /Oicf /use_epv /win32 /server none /out TestRpcClient /h AcmeTesting_w32.h /cstub AcmeTesting_w32_cli.c TestShared\AcmeTesting.idl 8 | 9 | midl /Oicf /use_epv /amd64 /server none /out TestRpcClient /h AcmeTesting_x64.h /cstub AcmeTesting_x64_cli.c TestShared\AcmeTesting.idl 10 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | A framework to help C++ programmers to code faster more robust and stable code. 2 | 3 | The scope of this project is to provide a modern framework that simplifies common tasks like error handling and logging, ISAM/relational data access and storage, heterogeneous programming and memory management. It was carefully engineered to provide high performance, low memory footprint, verbosity in error report, a simple interface compliant to the new C++11 standard and portability to several platforms: POSIX, Windows Vista/7/8/8.1/10/10 UWP. 4 | 5 | The provided features are: 6 | 7 | + A fully capable and flexible garbage collector that performs fast memory reclaim 8 | 9 | + A solid error and exception handling structure with stack tracing and logging with asynchronous IO (used by all the framework modules) 10 | 11 | + An OOP+RAII model for manipulation of relational data built on top of the latest stable releases of SQLite (the most widely deployed SQL embedded database engine in the world), with support for transactions, concurrent access and robust error handling 12 | 13 | + An OOP+RAII model for simplified heterogeneous programming that makes OpenCL v1.2 more practical and robust to employ 14 | 15 | + A module for ISAM data access backed by Microsoft ESE, but wrapped with real OOP+RAII design, which allows a much easier way to define, search and intersect multiple indexes 16 | 17 | + A module for SOAP web services containing helpers & wrappers around Microsoft WWS API, which enables quick development of native web services hosts and clients, including support for SSL transport security 18 | 19 | + A module with queue reader & writer for service broker of Microsoft SQL Server, that greatly simplifies its deployment and use 20 | -------------------------------------------------------------------------------- /SvcBrokerTest.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/SvcBrokerTest.bak -------------------------------------------------------------------------------- /TestRpcClient/AcmeTesting_w32.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */ 4 | 5 | 6 | /* File created by MIDL compiler version 8.01.0620 */ 7 | /* at Tue Jan 19 01:14:07 2038 8 | */ 9 | /* Compiler settings for TestShared\AcmeTesting.idl: 10 | Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0620 11 | protocol : dce , ms_ext, c_ext, robust 12 | error checks: allocation ref bounds_check enum stub_data , use_epv 13 | VC __declspec() decoration level: 14 | __declspec(uuid()), __declspec(selectany), __declspec(novtable) 15 | DECLSPEC_UUID(), MIDL_INTERFACE() 16 | */ 17 | /* @@MIDL_FILE_HEADING( ) */ 18 | 19 | #pragma warning( disable: 4049 ) /* more than 64k source lines */ 20 | 21 | 22 | /* verify that the version is high enough to compile this file*/ 23 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 24 | #define __REQUIRED_RPCNDR_H_VERSION__ 475 25 | #endif 26 | 27 | #include "rpc.h" 28 | #include "rpcndr.h" 29 | 30 | #ifndef __RPCNDR_H_VERSION__ 31 | #error this stub requires an updated version of 32 | #endif /* __RPCNDR_H_VERSION__ */ 33 | 34 | 35 | #ifndef __AcmeTesting_w32_h__ 36 | #define __AcmeTesting_w32_h__ 37 | 38 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 39 | #pragma once 40 | #endif 41 | 42 | /* Forward Declarations */ 43 | 44 | #ifdef __cplusplus 45 | extern "C"{ 46 | #endif 47 | 48 | 49 | #ifndef __AcmeTesting_INTERFACE_DEFINED__ 50 | #define __AcmeTesting_INTERFACE_DEFINED__ 51 | 52 | /* interface AcmeTesting */ 53 | /* [version][uuid] */ 54 | 55 | typedef struct pair 56 | { 57 | int left; 58 | int right; 59 | } pair; 60 | 61 | void Invert( 62 | /* [in] */ handle_t IDL_handle, 63 | /* [out][in] */ pair *onePair); 64 | 65 | void Operate( 66 | /* [in] */ handle_t IDL_handle, 67 | /* [in] */ double left, 68 | /* [in] */ double right, 69 | /* [out] */ double *result); 70 | 71 | void ChangeCase( 72 | /* [in] */ handle_t IDL_handle, 73 | /* [string][in] */ unsigned char *input, 74 | /* [size_is][string][out] */ unsigned char *output); 75 | 76 | void WriteOnStorage( 77 | /* [in] */ handle_t IDL_handle); 78 | 79 | unsigned long Shutdown( 80 | /* [in] */ handle_t IDL_handle); 81 | 82 | 83 | 84 | typedef struct _AcmeTesting_v1_0_epv_t 85 | { 86 | void ( *Invert )( 87 | /* [in] */ handle_t IDL_handle, 88 | /* [out][in] */ pair *onePair); 89 | void ( *Operate )( 90 | /* [in] */ handle_t IDL_handle, 91 | /* [in] */ double left, 92 | /* [in] */ double right, 93 | /* [out] */ double *result); 94 | void ( *ChangeCase )( 95 | /* [in] */ handle_t IDL_handle, 96 | /* [string][in] */ unsigned char *input, 97 | /* [size_is][string][out] */ unsigned char *output); 98 | void ( *WriteOnStorage )( 99 | /* [in] */ handle_t IDL_handle); 100 | unsigned long ( *Shutdown )( 101 | /* [in] */ handle_t IDL_handle); 102 | 103 | } AcmeTesting_v1_0_epv_t; 104 | 105 | extern RPC_IF_HANDLE AcmeTesting_v1_0_c_ifspec; 106 | extern RPC_IF_HANDLE AcmeTesting_v1_0_s_ifspec; 107 | #endif /* __AcmeTesting_INTERFACE_DEFINED__ */ 108 | 109 | /* Additional Prototypes for ALL interfaces */ 110 | 111 | /* end of Additional Prototypes */ 112 | 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | 117 | #endif 118 | 119 | 120 | -------------------------------------------------------------------------------- /TestRpcClient/AcmeTesting_x64.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */ 4 | 5 | 6 | /* File created by MIDL compiler version 8.01.0620 */ 7 | /* at Tue Jan 19 01:14:07 2038 8 | */ 9 | /* Compiler settings for TestShared\AcmeTesting.idl: 10 | Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0620 11 | protocol : dce , ms_ext, c_ext, robust 12 | error checks: allocation ref bounds_check enum stub_data , use_epv 13 | VC __declspec() decoration level: 14 | __declspec(uuid()), __declspec(selectany), __declspec(novtable) 15 | DECLSPEC_UUID(), MIDL_INTERFACE() 16 | */ 17 | /* @@MIDL_FILE_HEADING( ) */ 18 | 19 | #pragma warning( disable: 4049 ) /* more than 64k source lines */ 20 | 21 | 22 | /* verify that the version is high enough to compile this file*/ 23 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 24 | #define __REQUIRED_RPCNDR_H_VERSION__ 475 25 | #endif 26 | 27 | #include "rpc.h" 28 | #include "rpcndr.h" 29 | 30 | #ifndef __RPCNDR_H_VERSION__ 31 | #error this stub requires an updated version of 32 | #endif /* __RPCNDR_H_VERSION__ */ 33 | 34 | 35 | #ifndef __AcmeTesting_x64_h__ 36 | #define __AcmeTesting_x64_h__ 37 | 38 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 39 | #pragma once 40 | #endif 41 | 42 | /* Forward Declarations */ 43 | 44 | #ifdef __cplusplus 45 | extern "C"{ 46 | #endif 47 | 48 | 49 | #ifndef __AcmeTesting_INTERFACE_DEFINED__ 50 | #define __AcmeTesting_INTERFACE_DEFINED__ 51 | 52 | /* interface AcmeTesting */ 53 | /* [version][uuid] */ 54 | 55 | typedef struct pair 56 | { 57 | int left; 58 | int right; 59 | } pair; 60 | 61 | void Invert( 62 | /* [in] */ handle_t IDL_handle, 63 | /* [out][in] */ pair *onePair); 64 | 65 | void Operate( 66 | /* [in] */ handle_t IDL_handle, 67 | /* [in] */ double left, 68 | /* [in] */ double right, 69 | /* [out] */ double *result); 70 | 71 | void ChangeCase( 72 | /* [in] */ handle_t IDL_handle, 73 | /* [string][in] */ unsigned char *input, 74 | /* [size_is][string][out] */ unsigned char *output); 75 | 76 | void WriteOnStorage( 77 | /* [in] */ handle_t IDL_handle); 78 | 79 | unsigned long Shutdown( 80 | /* [in] */ handle_t IDL_handle); 81 | 82 | 83 | 84 | typedef struct _AcmeTesting_v1_0_epv_t 85 | { 86 | void ( *Invert )( 87 | /* [in] */ handle_t IDL_handle, 88 | /* [out][in] */ pair *onePair); 89 | void ( *Operate )( 90 | /* [in] */ handle_t IDL_handle, 91 | /* [in] */ double left, 92 | /* [in] */ double right, 93 | /* [out] */ double *result); 94 | void ( *ChangeCase )( 95 | /* [in] */ handle_t IDL_handle, 96 | /* [string][in] */ unsigned char *input, 97 | /* [size_is][string][out] */ unsigned char *output); 98 | void ( *WriteOnStorage )( 99 | /* [in] */ handle_t IDL_handle); 100 | unsigned long ( *Shutdown )( 101 | /* [in] */ handle_t IDL_handle); 102 | 103 | } AcmeTesting_v1_0_epv_t; 104 | 105 | extern RPC_IF_HANDLE AcmeTesting_v1_0_c_ifspec; 106 | extern RPC_IF_HANDLE AcmeTesting_v1_0_s_ifspec; 107 | #endif /* __AcmeTesting_INTERFACE_DEFINED__ */ 108 | 109 | /* Additional Prototypes for ALL interfaces */ 110 | 111 | /* end of Additional Prototypes */ 112 | 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | 117 | #endif 118 | 119 | 120 | -------------------------------------------------------------------------------- /TestRpcClient/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | CONSOLE APPLICATION : TestRpcClient Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this TestRpcClient application for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your TestRpcClient application. 9 | 10 | 11 | TestRpcClient.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | TestRpcClient.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | TestRpcClient.cpp 25 | This is the main application source file. 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | Other standard files: 29 | 30 | StdAfx.h, StdAfx.cpp 31 | These files are used to build a precompiled header (PCH) file 32 | named TestRpcClient.pch and a precompiled types file named StdAfx.obj. 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | Other notes: 36 | 37 | AppWizard uses "TODO:" comments to indicate parts of the source code you 38 | should add to or customize. 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | -------------------------------------------------------------------------------- /TestRpcClient/TestRpcClient.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 | {203ddbc4-2ceb-4046-8cfc-9302c90d71b3} 14 | 15 | 16 | {8ae87fe8-ade8-4886-be96-ac24f3c01336} 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Shared 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | pch 34 | 35 | 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Shared 48 | 49 | 50 | pch 51 | 52 | 53 | Shared 54 | 55 | 56 | Shared 57 | 58 | 59 | 60 | 61 | Resource Files 62 | 63 | 64 | 65 | 66 | Resource Files 67 | 68 | 69 | -------------------------------------------------------------------------------- /TestRpcClient/application.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /TestRpcClient/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 | -------------------------------------------------------------------------------- /TestRpcClient/pch.h: -------------------------------------------------------------------------------- 1 | #include <3fd/core/pch.h> -------------------------------------------------------------------------------- /TestShared/AcmeTesting.idl: -------------------------------------------------------------------------------- 1 | [ 2 | uuid(ba209999-0c6c-11d2-97cf-00c04f8eea45), 3 | version(1.0) 4 | ] 5 | interface AcmeTesting 6 | { 7 | #define STRBUFSIZE 256 8 | 9 | typedef struct pair 10 | { 11 | int left; 12 | int right; 13 | } pair; 14 | 15 | void Invert([in, out] pair *onePair); 16 | 17 | void Operate([in] double left, [in] double right, [out] double *result); 18 | 19 | void ChangeCase([in, string] char *input, [out, string, size_is(STRBUFSIZE)] char *output); 20 | 21 | void WriteOnStorage(void); 22 | 23 | unsigned long Shutdown(void); 24 | } 25 | -------------------------------------------------------------------------------- /TestShared/error_handling.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include <3fd/core/exceptions.h> 3 | #include <3fd/core/logger.h> 4 | #include 5 | #include 6 | 7 | namespace _3fd 8 | { 9 | namespace integration_tests 10 | { 11 | using namespace _3fd::core; 12 | 13 | /// 14 | /// Handles several types of exception. 15 | /// 16 | void HandleException() 17 | { 18 | try 19 | { 20 | throw; 21 | } 22 | catch(IAppException &appEx) 23 | { 24 | //std::cerr << appEx.ToString() << std::endl; 25 | core::Logger::Write(appEx, core::Logger::PRIO_ERROR); 26 | } 27 | catch(std::exception &stdEx) 28 | { 29 | std::cerr << stdEx.what() << std::endl; 30 | } 31 | catch(...) 32 | { 33 | std::cerr << "An unexpected exception has been caught." << std::endl; 34 | } 35 | 36 | FAIL(); 37 | } 38 | 39 | }// end of namespace integration_tests 40 | }// end of namespace _3fd 41 | -------------------------------------------------------------------------------- /TestShared/main.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 <3fd/core/runtime.h> 8 | #include 9 | 10 | #ifdef _MSC_VER 11 | # ifdef _3FD_PLATFORM_WIN32API // Win32 Console: 12 | int wmain(int argc, wchar_t *argv[]) 13 | { 14 | std::cout << "Running wmain() from " __FILE__ << std::endl; 15 | _3fd::core::SetupMemoryLeakDetection(); 16 | testing::InitGoogleTest(&argc, argv); 17 | return RUN_ALL_TESTS(); 18 | } 19 | 20 | # else // UWP Console: 21 | int main() 22 | { 23 | std::cout << "Running main() from " __FILE__ << std::endl; 24 | testing::InitGoogleTest(&__argc, __argv); 25 | 26 | // After InitGoogleTest! (takes snapshot of the heap later) 27 | _3fd::core::SetupMemoryLeakDetection(); 28 | 29 | int rc = RUN_ALL_TESTS(); 30 | getchar(); 31 | return rc; 32 | } 33 | # endif 34 | 35 | #else // POSIX: 36 | int main(int argc, char *argv[]) 37 | { 38 | std::cout << "Running wmain() from " __FILE__ << std::endl; 39 | testing::InitGoogleTest(&argc, argv); 40 | return RUN_ALL_TESTS(); 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /TestShared/rpc_test_shared.cpp: -------------------------------------------------------------------------------- 1 | #include "rpc_test_shared.h" 2 | 3 | namespace _3fd 4 | { 5 | namespace integration_tests 6 | { 7 | const std::array objectsUuidsImpl1 = 8 | { 9 | "BF7653EF-EB6D-4CF5-BEF0-B4D27864D750", 10 | "6642C890-14CF-4A9B-A35F-4C860A1DEBDE", 11 | "6442FFD6-1688-4DF0-B2CD-E1633CE30027", 12 | "5C4E56F6-C92E-4268-BEFA-CC55A2FF833D", 13 | "B3CCEEFD-990B-462D-B919-DAC45ACD8230", 14 | "D9D3881F-453F-48AC-A860-3B6AB31F8C6F", 15 | "232C45E2-8E6C-41C0-9917-D534F8CDE969", 16 | "6991C2E3-A969-4D81-B4B6-649770D97C62", 17 | "15334E7D-6408-4339-8464-45F29B14E2A9", 18 | "7633B429-F11E-4976-9A2D-8F7CD5A5C3E7", 19 | "A334E4CB-31CA-4C57-9B82-61720AE8EE83", 20 | "2E8D4583-6713-4320-9329-E7D51DD776C2", 21 | "B9887CE8-D721-432E-997E-6567F6123818", 22 | "934F7800-1F8D-4A23-BCE4-30EC3267E49A", 23 | "229BC8E0-DD3F-46BB-B942-5B10A4F69913", 24 | "DEDD2C6E-92F5-4FD0-AD32-DB112271A1C3", 25 | "ED3D4DE2-E966-4C35-BDEB-DEF9D09479BA", 26 | "353766CD-97A3-45B1-9E91-91EAC9CDCD99", 27 | "27E80D9D-7C26-4BF5-B9E7-C60EDA9E8D23", 28 | "1E1D508E-4816-4553-BD74-43098F3E33EC" 29 | }; 30 | 31 | const std::array objectsUuidsImpl2 = 32 | { 33 | "684F4A12-FF51-4E7C-8611-CD4F54E5D042", 34 | "70A02E35-223C-47D4-8690-09AB0AF43B54", 35 | "22588C8D-12F4-49DE-BFA7-FD27E8AAF53D", 36 | "94BBCAE5-E3C3-4899-BDE0-6889CBF441A2", 37 | "37277527-6CE7-4FC4-B4D2-E44676C2E256", 38 | "FA263BF8-C883-4478-B873-053077DF6093", 39 | "255301C0-3FC5-4AF8-8BEF-33B6D17EA977", 40 | "FFC6B0EC-3486-4D04-91CF-8E63048545B6", 41 | "153C2AE0-1B9C-4CC5-A83C-8B40EC8B832F", 42 | "334E8550-5F3B-4EDF-935C-B0CD42B6ED33", 43 | "3296A63C-D419-49C7-89E4-12F7247D2A72", 44 | "2C091B97-C83A-43F4-B8A9-3FCF5EDE123A", 45 | "CF14569A-DC76-48C4-A640-CEB014D9125A", 46 | "6182B60D-FD46-49D7-B272-F481BA6EE439", 47 | "CE81527B-E990-410D-BAF0-770A05D2EE1F", 48 | "14B896C9-A5A7-4EF8-A242-B900BBCF8B7C", 49 | "390A1B9E-1518-4068-BF31-1B5F7977108A", 50 | "84B7A0FB-60C7-4820-A893-E67065335A1C", 51 | "3D614913-450A-4643-8647-C410B7A23252", 52 | "97273BD4-45CB-47B4-B03A-6C3597EB8F86" 53 | }; 54 | 55 | }// end of namespace integration_tests 56 | }// end of namespace _3fd -------------------------------------------------------------------------------- /TestShared/rpc_test_shared.h: -------------------------------------------------------------------------------- 1 | #ifndef RPC_TEST_SHARED_H // header guard 2 | #define RPC_TEST_SHARED_H 3 | 4 | #include <3fd/rpc/rpc_helpers.h> 5 | #include 6 | #include 7 | 8 | // Choose the scenario uncommenting one of the following macros: 9 | 10 | #define SCENARIO_SINGLE_BOX_LOCAL_SEC 11 | //#define SCENARIO_SINGLE_BOX_AD_SEC 12 | //#define SCENARIO_REMOTE_WITH_AD_SEC 13 | 14 | namespace _3fd 15 | { 16 | namespace integration_tests 17 | { 18 | /* In this implementation: 19 | Operate(left, right) = left * right 20 | ChangeCase(input) = toUpper(input) 21 | */ 22 | extern const std::array objectsUuidsImpl1; 23 | 24 | /* In this implementation: 25 | Operate(left, right) = left + right 26 | ChangeCase(input) = toLower(input) 27 | */ 28 | extern const std::array objectsUuidsImpl2; 29 | 30 | /// 31 | /// A set of options to be used as variable parameters of test cases 32 | /// for RPC module with Schannel SSP in both server & client sides. 33 | /// 34 | struct SchannelTestOptions 35 | { 36 | const char *objectUUID1; 37 | const char *objectUUID2; 38 | rpc::AuthenticationLevel authenticationLevel; 39 | bool useStrongSec; 40 | }; 41 | 42 | const auto paramsForSchannelTests = ::testing::Values( 43 | SchannelTestOptions{ objectsUuidsImpl1[16], objectsUuidsImpl2[16], rpc::AuthenticationLevel::Privacy, false }, 44 | SchannelTestOptions{ objectsUuidsImpl1[17], objectsUuidsImpl2[17], rpc::AuthenticationLevel::Privacy, true }, 45 | SchannelTestOptions{ objectsUuidsImpl1[18], objectsUuidsImpl2[18], rpc::AuthenticationLevel::Integrity, false }, 46 | SchannelTestOptions{ objectsUuidsImpl1[19], objectsUuidsImpl2[19], rpc::AuthenticationLevel::Integrity, true } 47 | ); 48 | 49 | }// end of namespace integration_tests 50 | }// end of namespace _3fd 51 | 52 | #endif // end of header guard 53 | -------------------------------------------------------------------------------- /TestWwsClient/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | CONSOLE APPLICATION : TestWwsClient Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this TestWwsClient application for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your TestWwsClient application. 9 | 10 | 11 | TestWwsClient.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | TestWwsClient.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | TestWwsClient.cpp 25 | This is the main application source file. 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | Other standard files: 29 | 30 | StdAfx.h, StdAfx.cpp 31 | These files are used to build a precompiled header (PCH) file 32 | named TestWwsClient.pch and a precompiled types file named StdAfx.obj. 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | Other notes: 36 | 37 | AppWizard uses "TODO:" comments to indicate parts of the source code you 38 | should add to or customize. 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | -------------------------------------------------------------------------------- /TestWwsClient/TestWwsClient.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 | {ff664ba5-df71-4c7b-8679-6f283d598512} 14 | 15 | 16 | {475296b6-1451-4be2-866a-86832a972760} 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | pch 28 | 29 | 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | pch 39 | 40 | 41 | Shared 42 | 43 | 44 | Shared 45 | 46 | 47 | 48 | 49 | Resource Files 50 | 51 | 52 | -------------------------------------------------------------------------------- /TestWwsClient/application.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /TestWwsClient/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 | -------------------------------------------------------------------------------- /TestWwsClient/pch.h: -------------------------------------------------------------------------------- 1 | #include <3fd/core/pch.h> -------------------------------------------------------------------------------- /UnitTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(UnitTests) 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 | -DTESTING 20 | ) 21 | 22 | ######################## 23 | # Include directories: 24 | 25 | include_directories( 26 | "${PROJECT_SOURCE_DIR}" 27 | "${PROJECT_SOURCE_DIR}/../" 28 | "${PROJECT_SOURCE_DIR}/../gtest/include/" 29 | ) 30 | 31 | ######################## 32 | # Dependency libraries: 33 | 34 | # How and what external libs to link: 35 | #add_library(PocoFoundation STATIC IMPORTED) 36 | 37 | # Where the lib binaries are: 38 | string(TOLOWER ${CMAKE_BUILD_TYPE} buildType) 39 | if(buildType STREQUAL release) 40 | add_definitions(-DNDEBUG) 41 | set_target_properties(3fd-core PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/../3fd/core/lib3fd-core.a") 42 | set_target_properties(3fd-utils PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/../3fd/utils/lib3fd-utils.a") 43 | set_target_properties(gtest PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/../gtest/libgtest.a") 44 | # set_target_properties(PocoFoundation PROPERTIES IMPORTED_LOCATION "$ENV{LIB_DEPS_DIR}/lib/libPocoFoundation.a") 45 | elseif(buildType STREQUAL debug) 46 | set_target_properties(3fd-core PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/../3fd/core/lib3fd-cored.a") 47 | set_target_properties(3fd-utils PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/../3fd/utils/lib3fd-utilsd.a") 48 | set_target_properties(gtest PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/../gtest/libgtestd.a") 49 | # set_target_properties(PocoFoundation PROPERTIES IMPORTED_LOCATION "$ENV{LIB_DEPS_DIR}/lib/libPocoFoundationd.a") 50 | endif() 51 | 52 | # Place the configuration file along with the executable: 53 | add_custom_command( 54 | OUTPUT UnitTests.3fd.config 55 | COMMAND cp ${PROJECT_SOURCE_DIR}/application.config $ENV{BUILD_DIR}/bin/UnitTests.3fd.config 56 | DEPENDS ${PROJECT_SOURCE_DIR}/application.config 57 | ) 58 | 59 | # Executable source files: 60 | add_executable(UnitTests 61 | ../TestShared/main.cpp 62 | tests_gc_arrayofedges.cpp 63 | tests_gc_hashtable.cpp 64 | tests_gc_vertex.cpp 65 | tests_gc_vertexstore.cpp 66 | tests_utils_algorithms.cpp 67 | tests_utils_cache.cpp 68 | tests_utils_cmdline.cpp 69 | tests_utils_serialization.cpp 70 | tests_utils_lockfreequeue.cpp 71 | tests_utils_pool.cpp 72 | tests_utils_text.cpp 73 | tests_xml.cpp 74 | UnitTests.3fd.config 75 | ) 76 | 77 | # Linking: 78 | target_link_libraries(UnitTests 79 | gtest 80 | 3fd-core 81 | 3fd-utils 82 | # PocoFoundation 83 | pthread dl stdc++fs 84 | ) 85 | 86 | ################ 87 | # Installation: 88 | 89 | install( 90 | TARGETS UnitTests 91 | DESTINATION "$ENV{BUILD_DIR}/bin" 92 | ) 93 | -------------------------------------------------------------------------------- /UnitTests/UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /UnitTests/UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /UnitTests/UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /UnitTests/UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /UnitTests/UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /UnitTests/UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /UnitTests/UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /UnitTests/UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | UnitTestsApp 21 | felip 22 | Assets\StoreLogo.png 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 42 | 48 | 49 | 50 | 51 | 52 | 53 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /UnitTests/UWP/UnitTestsApp.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | b3f6666b-a557-4c4d-9e89-3d0faa275f52 6 | 7 | 8 | 71ea196a-c224-4407-b3f8-c86b861a283e 9 | bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png 10 | 11 | 12 | {74acfff7-a67d-44a3-821f-d95fef17c21d} 13 | 14 | 15 | {1e284e85-cef3-4ec3-bcae-f91da6d65e08} 16 | 17 | 18 | 19 | 20 | Ported 21 | 22 | 23 | Ported 24 | 25 | 26 | Ported 27 | 28 | 29 | Ported 30 | 31 | 32 | Ported 33 | 34 | 35 | Ported 36 | 37 | 38 | Ported 39 | 40 | 41 | Ported 42 | 43 | 44 | pch 45 | 46 | 47 | Common 48 | 49 | 50 | Ported 51 | 52 | 53 | Ported 54 | 55 | 56 | Ported 57 | 58 | 59 | 60 | 61 | Assets 62 | 63 | 64 | Assets 65 | 66 | 67 | Assets 68 | 69 | 70 | Assets 71 | 72 | 73 | Assets 74 | 75 | 76 | Assets 77 | 78 | 79 | Assets 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | pch 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /UnitTests/UWP/UnitTestsApp_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faburaya/3fd/cde5d33a2e22dc6a02423334b0a8b766348cb296/UnitTests/UWP/UnitTestsApp_TemporaryKey.pfx -------------------------------------------------------------------------------- /UnitTests/UWP/a2e1e6a8-499e-45a2-b51c-c26d343dbae3.3fd.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UnitTests/UnitTests.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 | {057cf2cd-d132-487b-a974-a6dae8523905} 14 | 15 | 16 | {a39acdfb-b648-4dc5-aab5-aa039b513db1} 17 | 18 | 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | pch 46 | 47 | 48 | Shared 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Resource Files 69 | 70 | 71 | 72 | 73 | pch 74 | 75 | 76 | -------------------------------------------------------------------------------- /UnitTests/_dummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Deutsch 5 | 6.96 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /UnitTests/application.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /UnitTests/install_manifest.txt: -------------------------------------------------------------------------------- 1 | /mnt/c/Users/felip/source/repos/3fd/build/bin/UnitTests 2 | /mnt/c/Users/felip/source/repos/3fd/build/lib/lib3FDd.a -------------------------------------------------------------------------------- /UnitTests/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 | -------------------------------------------------------------------------------- /UnitTests/pch.h: -------------------------------------------------------------------------------- 1 | #include <3fd/core/pch.h> 2 | -------------------------------------------------------------------------------- /UnitTests/tests_gc_hashtable.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 <3fd/core/runtime.h> 8 | #include <3fd/core/gc_addresseshashtable.h> 9 | #include <3fd/core/gc_vertex.h> 10 | 11 | #include 12 | 13 | namespace _3fd 14 | { 15 | namespace unit_tests 16 | { 17 | using memory::Vertex; 18 | 19 | struct Dummy 20 | { 21 | int someVar1, 22 | someVar2, 23 | someVar3; 24 | 25 | void *ptr; 26 | Vertex *pointedVtx; 27 | Vertex *containerVtx; 28 | 29 | Dummy() : 30 | someVar1(42), 31 | someVar2(42), 32 | someVar3(42) 33 | { 34 | ptr = &someVar1; 35 | pointedVtx = (Vertex *)&someVar2; 36 | containerVtx = (Vertex *)&someVar3; 37 | } 38 | }; 39 | 40 | /// 41 | /// Tests class for basic insertion / retrieval / removal. 42 | /// 43 | TEST(Framework_MemoryGC_TestCase, AddressesHashTable_BasicTest) 44 | { 45 | // Ensures proper initialization/finalization of the framework 46 | # ifdef _3FD_PLATFORM_WINRT 47 | core::FrameworkInstance _framework("UnitTestsApp.WinRT.UWP"); 48 | # else 49 | core::FrameworkInstance _framework; 50 | # endif 51 | 52 | memory::AddressesHashTable hashtable; 53 | std::vector entries(4096); 54 | 55 | // Fill the hash table with some dummy entries: 56 | for (auto &entry : entries) 57 | { 58 | auto &ref = hashtable.Insert(&entry.ptr, entry.pointedVtx, entry.containerVtx); 59 | 60 | EXPECT_EQ(&entry.ptr, ref.GetSptrObjectAddr()); 61 | EXPECT_EQ(entry.pointedVtx, ref.GetPointedMemBlock()); 62 | EXPECT_EQ(entry.containerVtx, ref.GetContainerMemBlock()); 63 | EXPECT_FALSE(ref.IsRoot()); 64 | } 65 | 66 | // Try retrieving the entries: 67 | for (auto &entry : entries) 68 | { 69 | auto &ref = hashtable.Lookup(&entry.ptr); 70 | 71 | EXPECT_EQ(&entry.ptr, ref.GetSptrObjectAddr()); 72 | EXPECT_EQ(entry.pointedVtx, ref.GetPointedMemBlock()); 73 | EXPECT_EQ(entry.containerVtx, ref.GetContainerMemBlock()); 74 | EXPECT_FALSE(ref.IsRoot()); 75 | 76 | hashtable.Remove(&entry.ptr); 77 | } 78 | 79 | // Do it all over again, for "root" elements: 80 | 81 | for (auto &entry : entries) 82 | { 83 | auto &ref = hashtable.Insert(&entry.ptr, entry.pointedVtx, nullptr); 84 | 85 | EXPECT_EQ(&entry.ptr, ref.GetSptrObjectAddr()); 86 | EXPECT_EQ(entry.pointedVtx, ref.GetPointedMemBlock()); 87 | EXPECT_EQ(nullptr, ref.GetContainerMemBlock()); 88 | EXPECT_TRUE(ref.IsRoot()); 89 | } 90 | 91 | for (auto &entry : entries) 92 | { 93 | auto &ref = hashtable.Lookup(&entry.ptr); 94 | 95 | EXPECT_EQ(&entry.ptr, ref.GetSptrObjectAddr()); 96 | EXPECT_EQ(entry.pointedVtx, ref.GetPointedMemBlock()); 97 | EXPECT_EQ(nullptr, ref.GetContainerMemBlock()); 98 | EXPECT_TRUE(ref.IsRoot()); 99 | 100 | hashtable.Remove(ref); 101 | } 102 | } 103 | 104 | }// end of namespace unit_tests 105 | }// end of namespace _3fd 106 | -------------------------------------------------------------------------------- /UnitTests/tests_gc_vertexstore.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 <3fd/core/runtime.h> 8 | #include <3fd/core/gc_vertexstore.h> 9 | #include <3fd/core/sptr.h> 10 | 11 | #include 12 | 13 | #ifdef _WIN32 14 | # define ALIGNED_NEW(TYPE, INITIALIZER) new (_aligned_malloc(sizeof (TYPE), 2)) TYPE INITIALIZER 15 | #else 16 | # define ALIGNED_NEW(TYPE, INITIALIZER) new (aligned_alloc(2, sizeof (TYPE))) TYPE INITIALIZER 17 | #endif 18 | 19 | namespace _3fd 20 | { 21 | namespace unit_tests 22 | { 23 | struct Stuffed 24 | { 25 | int low; 26 | int middle; 27 | int high; 28 | }; 29 | 30 | /// 31 | /// Tests class for retrieval of vertices and container logic. 32 | /// 33 | TEST(Framework_MemoryGC_TestCase, VertexStore_RetrievalTest) 34 | { 35 | // Ensures proper initialization/finalization of the framework 36 | core::FrameworkInstance _framework; 37 | 38 | const int n = 128; 39 | std::vector addrs; 40 | memory::VertexStore vtxStore; 41 | 42 | // Add some vertices: 43 | addrs.reserve(n); 44 | for (int count = 0; count < n; ++count) 45 | { 46 | auto ptr = ALIGNED_NEW(Stuffed, ()); 47 | addrs.push_back(ptr); 48 | vtxStore.AddVertex(ptr, sizeof *ptr, &memory::FreeMemAddr); 49 | } 50 | 51 | // Try retriving the vertices: 52 | for (auto ptr : addrs) 53 | { 54 | auto vtx = vtxStore.GetVertex(ptr); 55 | EXPECT_EQ(ptr, vtx->GetMemoryAddress().Get()); 56 | } 57 | 58 | // Try retrieving container vertices: 59 | for (auto ptr : addrs) 60 | { 61 | auto vtx1 = vtxStore.GetContainerVertex(&(ptr->low)); 62 | auto vtx2 = vtxStore.GetContainerVertex(&(ptr->middle)); 63 | auto vtx3 = vtxStore.GetContainerVertex(&(ptr->high)); 64 | 65 | EXPECT_EQ(vtx1, vtx2); 66 | EXPECT_EQ(vtx2, vtx3); 67 | EXPECT_EQ(vtx3, vtx1); 68 | 69 | EXPECT_EQ(ptr, vtx1->GetMemoryAddress().Get()); 70 | } 71 | 72 | // Remove all vertices: 73 | for (int idx = 0; idx < n; ++idx) 74 | { 75 | auto vtx = vtxStore.GetVertex(addrs[idx]); 76 | vtxStore.RemoveVertex(vtx); 77 | vtx->ReleaseReprObjResources(true); 78 | delete vtx; 79 | } 80 | } 81 | 82 | }// end of namespace unit_tests 83 | }// end of namespace _3fd 84 | -------------------------------------------------------------------------------- /UnitTests/tests_utils_pool.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 <3fd/utils/memory.h> 8 | 9 | #include 10 | #include 11 | 12 | namespace _3fd 13 | { 14 | namespace unit_tests 15 | { 16 | /// 17 | /// Something to be stuffed into an object pool. 18 | /// 19 | class MyClass 20 | { 21 | private: 22 | 23 | std::deque m_integers; 24 | 25 | static utils::DynamicMemPool *dynMemPool; 26 | 27 | public: 28 | 29 | static void SetMemoryPool(utils::DynamicMemPool &ob) 30 | { 31 | dynMemPool = &ob; 32 | } 33 | 34 | void *operator new(size_t) 35 | { 36 | return dynMemPool->GetFreeBlock(); 37 | } 38 | 39 | void operator delete(void *ptr) 40 | { 41 | dynMemPool->ReturnBlock(ptr); 42 | } 43 | 44 | MyClass() 45 | : m_integers(32) {} 46 | 47 | void Fill() 48 | { 49 | for (int index = 0; index < m_integers.size(); ++index) 50 | m_integers[index] = index * index; 51 | } 52 | 53 | void ShowContent() 54 | { 55 | #ifdef _3FD_CONSOLE_AVAILABLE 56 | std::cout << "Content of the object " << this << ": "; 57 | 58 | for (int index = 0; index < m_integers.size(); ++index) 59 | std::cout << m_integers[index] << " "; 60 | 61 | std::cout << '\n'; 62 | #endif 63 | } 64 | }; 65 | 66 | utils::DynamicMemPool * MyClass::dynMemPool(nullptr); 67 | 68 | /// 69 | /// Generic tests for class. 70 | /// 71 | TEST(Framework_Utils_TestCase, DynamicMemPool_BasicTest) 72 | { 73 | const size_t poolSize = 2048; 74 | 75 | utils::DynamicMemPool myPool(poolSize, sizeof(MyClass), 1.0F); 76 | 77 | MyClass::SetMemoryPool(myPool); 78 | 79 | std::vector myObjects(poolSize * 4); 80 | 81 | // Creating the objects for the first time: 82 | for (uint32_t index = 0; index < myObjects.size(); ++index) 83 | { 84 | myObjects[index] = new MyClass; 85 | myObjects[index]->Fill(); 86 | } 87 | 88 | //myObjects[0]->ShowContent(); 89 | 90 | // Return all objects to the pool: 91 | for (uint32_t index = 0; index < myObjects.size(); ++index) 92 | delete myObjects[index]; 93 | 94 | // After the objects have been returned to the pool, they are gotten again: 95 | for (uint32_t index = 0; index < myObjects.size(); ++index) 96 | myObjects[index] = new MyClass; 97 | 98 | //myObjects[0]->ShowContent(); 99 | 100 | // And this time, return only half the total of objects: 101 | auto half = myObjects.size() / 2; 102 | for (uint32_t index = 0; index < half; ++index) 103 | delete myObjects[index]; 104 | 105 | // Then shrink to cut out an eventual excess: 106 | myPool.Shrink(); 107 | 108 | // Reclaim the returned half: 109 | for (uint32_t index = 0; index < half; ++index) 110 | myObjects[index] = new MyClass; 111 | 112 | // Return all objects to the pool: 113 | for (uint32_t index = 0; index < myObjects.size(); ++index) 114 | delete myObjects[index]; 115 | 116 | myPool.Shrink(); 117 | } 118 | 119 | }// end of namespace unit_tests 120 | }// end of namespace _3fd 121 | -------------------------------------------------------------------------------- /WsutilCompileWwsTestWsdl.bat: -------------------------------------------------------------------------------- 1 | call "%VS140COMNTOOLS%\VsDevCmd.bat" 2 | 3 | cd IntegrationTests 4 | wsutil /noclient /wsdl:..\TestShared\calculator.wsdl 5 | 6 | cd ..\TestWwsClient 7 | wsutil /noservice /wsdl:..\TestShared\calculator.wsdl 8 | 9 | cd .. -------------------------------------------------------------------------------- /btree/stx/btree: -------------------------------------------------------------------------------- 1 | // -*- mode: c++ -*- 2 | /******************************************************************************* 3 | * include/stx/btree 4 | * 5 | * STX B+ Tree Template Classes v0.9 6 | * Copyright (C) 2008-2013 Timo Bingmann 7 | * 8 | * Boost Software License - Version 1.0 - August 17th, 2003 9 | * 10 | * Permission is hereby granted, free of charge, to any person or organization 11 | * obtaining a copy of the software and accompanying documentation covered by 12 | * this license (the "Software") to use, reproduce, display, distribute, 13 | * execute, and transmit the Software, and to prepare derivative works of the 14 | * Software, and to permit third-parties to whom the Software is furnished to 15 | * do so, all subject to the following: 16 | * 17 | * The copyright notices in the Software and this entire statement, including 18 | * the above license grant, this restriction and the following disclaimer, must 19 | * be included in all copies of the Software, in whole or in part, and all 20 | * derivative works of the Software, unless such copies or derivative works are 21 | * solely in the form of machine-executable object code generated by a source 22 | * language processor. 23 | * 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 27 | * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 28 | * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 29 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 30 | * DEALINGS IN THE SOFTWARE. 31 | ******************************************************************************/ 32 | 33 | #ifndef _STX_BTREE_ 34 | #define _STX_BTREE_ 35 | 36 | /** \file btree 37 | * Forwarder header to btree.h 38 | */ 39 | 40 | #include 41 | 42 | #endif // _STX_BTREE_ 43 | 44 | /******************************************************************************/ 45 | -------------------------------------------------------------------------------- /btree/stx/btree_set: -------------------------------------------------------------------------------- 1 | // -*- mode: c++ -*- 2 | /******************************************************************************* 3 | * include/stx/btree_set 4 | * 5 | * STX B+ Tree Template Classes v0.9 6 | * Copyright (C) 2008-2013 Timo Bingmann 7 | * 8 | * Boost Software License - Version 1.0 - August 17th, 2003 9 | * 10 | * Permission is hereby granted, free of charge, to any person or organization 11 | * obtaining a copy of the software and accompanying documentation covered by 12 | * this license (the "Software") to use, reproduce, display, distribute, 13 | * execute, and transmit the Software, and to prepare derivative works of the 14 | * Software, and to permit third-parties to whom the Software is furnished to 15 | * do so, all subject to the following: 16 | * 17 | * The copyright notices in the Software and this entire statement, including 18 | * the above license grant, this restriction and the following disclaimer, must 19 | * be included in all copies of the Software, in whole or in part, and all 20 | * derivative works of the Software, unless such copies or derivative works are 21 | * solely in the form of machine-executable object code generated by a source 22 | * language processor. 23 | * 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 27 | * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 28 | * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 29 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 30 | * DEALINGS IN THE SOFTWARE. 31 | ******************************************************************************/ 32 | 33 | #ifndef _STX_BTREE_SET_ 34 | #define _STX_BTREE_SET_ 35 | 36 | /** \file btree_set 37 | * Forwarder header to btree_set.h 38 | */ 39 | 40 | #include 41 | 42 | #endif // _STX_BTREE_SET_ 43 | 44 | /******************************************************************************/ 45 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mode=$1; 4 | 5 | if [ -n "$mode" ] && [ -n "$(echo $mode | grep -i '^debug$')" ]; 6 | then 7 | CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=$mode -DCMAKE_DEBUG_POSTFIX=d"; 8 | 9 | elif [ -n "$mode" ] && [ -n "$(echo $mode | grep -i '^release$')" ]; 10 | then 11 | CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=$mode"; 12 | 13 | else 14 | printf 'ERROR! Usage: ./build.sh [debug|release]\n\n'; 15 | exit; 16 | fi 17 | 18 | export BUILD_DIR=$(pwd)/build; 19 | 20 | { ls $BUILD_DIR/lib || mkdir -p $BUILD_DIR/lib; } &> /dev/null; 21 | { ls $BUILD_DIR/bin || mkdir -p $BUILD_DIR/bin; } &> /dev/null; 22 | 23 | cmake $CMAKE_OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=1; 24 | numCpuCores=$(grep -c ^processor /proc/cpuinfo); 25 | make -j $numCpuCores && make install; 26 | 27 | { ls $BUILD_DIR/include/btree || mkdir -p $BUILD_DIR/include/btree; } &> /dev/null; 28 | cp -rf btree $BUILD_DIR/include/btree/; 29 | 30 | function copyHeaders() 31 | { 32 | local moduleRelativePath=$1; 33 | { ls $BUILD_DIR/include/$moduleRelativePath || mkdir -p $BUILD_DIR/include/$moduleRelativePath; } &> /dev/null; 34 | find $moduleRelativePath -maxdepth 1 -type f | grep '\.h$' | grep -v "_impl\|_winrt\|pch.h\|targetver.h" | xargs -I{} cp {} build/include/$moduleRelativePath; 35 | } 36 | 37 | copyHeaders 3fd/core; 38 | copyHeaders 3fd/utils; 39 | copyHeaders 3fd/sqlite; 40 | copyHeaders 3fd/broker; 41 | copyHeaders 3fd/opencl; 42 | copyHeaders 3fd/opencl/CL; 43 | 44 | cp Acknowledgements.txt $BUILD_DIR/; 45 | cp LICENSE $BUILD_DIR/; 46 | cp README $BUILD_DIR/; 47 | -------------------------------------------------------------------------------- /gtest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /gtest/include/gtest/gtest_prod.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Google C++ Testing Framework definitions useful in production code. 33 | 34 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 35 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 36 | 37 | // When you need to test the private or protected members of a class, 38 | // use the FRIEND_TEST macro to declare your tests as friends of the 39 | // class. For example: 40 | // 41 | // class MyClass { 42 | // private: 43 | // void MyMethod(); 44 | // FRIEND_TEST(MyClassTest, MyMethod); 45 | // }; 46 | // 47 | // class MyClassTest : public testing::Test { 48 | // // ... 49 | // }; 50 | // 51 | // TEST_F(MyClassTest, MyMethod) { 52 | // // Can call MyClass::MyMethod() here. 53 | // } 54 | 55 | #define FRIEND_TEST(test_case_name, test_name)\ 56 | friend class test_case_name##_##test_name##_Test 57 | 58 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 59 | -------------------------------------------------------------------------------- /gtest/msvc/gtest-md.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 15 3 | VisualStudioVersion = 15.0.28307.1000 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-md", "gtest-md.vcxproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}" 6 | EndProject 7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main-md", "gtest_main-md.vcxproj", "{3AF54C8A-10BF-4332-9147-F68ED9862033}" 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-winrt", "gtest-winrt.vcxproj", "{B650C884-6640-4FEE-9C5B-62E4D84D9E0F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|ARM = Debug|ARM 14 | Debug|x64 = Debug|x64 15 | Release|ARM = Release|ARM 16 | Release|x64 = Release|x64 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug|ARM.ActiveCfg = Debug|x64 20 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug|x64.ActiveCfg = Debug|x64 21 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug|x64.Build.0 = Debug|x64 22 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release|ARM.ActiveCfg = Release|x64 23 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release|x64.ActiveCfg = Release|x64 24 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release|x64.Build.0 = Release|x64 25 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Debug|ARM.ActiveCfg = Debug|x64 26 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Debug|x64.ActiveCfg = Debug|x64 27 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Release|ARM.ActiveCfg = Release|x64 28 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Release|x64.ActiveCfg = Release|x64 29 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Debug|ARM.ActiveCfg = Debug|ARM 30 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Debug|ARM.Build.0 = Debug|ARM 31 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Debug|x64.ActiveCfg = Debug|x64 32 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Debug|x64.Build.0 = Debug|x64 33 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Release|ARM.ActiveCfg = Release|ARM 34 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Release|ARM.Build.0 = Release|ARM 35 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Release|x64.ActiveCfg = Release|x64 36 | {B650C884-6640-4FEE-9C5B-62E4D84D9E0F}.Release|x64.Build.0 = Release|x64 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {7D73C92E-8D3F-43D6-8218-E8F5BB86C88A} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /gtest/msvc/gtest-md.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gtest/msvc/gtest-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 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gtest/msvc/gtest_main-md.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /gtest/msvc/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /gtest/msvc/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "targetver.h" 4 | 5 | #ifndef WIN32_LEAN_AND_MEAN 6 | #define WIN32_LEAN_AND_MEAN 7 | #endif 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /gtest/msvc/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /gtest/src/gtest-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build Google Test by compiling a single file. 35 | // This file serves this purpose. 36 | 37 | // This line ensures that gtest.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gtest/gtest.h" 40 | 41 | // The following lines pull in the real gtest *.cc files. 42 | #include "src/gtest.cc" 43 | #include "src/gtest-death-test.cc" 44 | #include "src/gtest-filepath.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | -------------------------------------------------------------------------------- /gtest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /install_vsrbdeps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # install packages that are needed by Visual C++ remote build in this machine 3 | sudo apt install openssh-server g++ gdb gdbserver zip 4 | 5 | -------------------------------------------------------------------------------- /nanodbc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(nanodbc) 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 | endif() 10 | 11 | ##################### 12 | # Macro definitions: 13 | 14 | add_definitions( 15 | # -DSOMETHING 16 | ) 17 | 18 | # NDEBUG when release mode: 19 | string(TOLOWER ${CMAKE_BUILD_TYPE} buildType) 20 | if(buildType STREQUAL release) 21 | add_definitions(-DNDEBUG) 22 | endif() 23 | 24 | ######################## 25 | # Include directories: 26 | 27 | include_directories( 28 | "${PROJECT_SOURCE_DIR}/../" 29 | ) 30 | 31 | ######################## 32 | # Dependency libraries: 33 | 34 | # Static library source files: 35 | add_library(nanodbc STATIC 36 | nanodbc.cpp 37 | ) 38 | 39 | ################ 40 | # Installation: 41 | 42 | install( 43 | TARGETS nanodbc 44 | DESTINATION "${PROJECT_SOURCE_DIR}/../build/lib" 45 | ) -------------------------------------------------------------------------------- /nanodbc/nanodbc.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 | 14 | 15 | Quelldateien 16 | 17 | 18 | 19 | 20 | Quelldateien 21 | 22 | 23 | -------------------------------------------------------------------------------- /rapidxml/license.txt: -------------------------------------------------------------------------------- 1 | Use of this software is granted under one of the following two licenses, 2 | to be chosen freely by the user. 3 | 4 | 1. Boost Software License - Version 1.0 - August 17th, 2003 5 | =============================================================================== 6 | 7 | Copyright (c) 2006, 2007 Marcin Kalicinski 8 | 9 | Permission is hereby granted, free of charge, to any person or organization 10 | obtaining a copy of the software and accompanying documentation covered by 11 | this license (the "Software") to use, reproduce, display, distribute, 12 | execute, and transmit the Software, and to prepare derivative works of the 13 | Software, and to permit third-parties to whom the Software is furnished to 14 | do so, all subject to the following: 15 | 16 | The copyright notices in the Software and this entire statement, including 17 | the above license grant, this restriction and the following disclaimer, 18 | must be included in all copies of the Software, in whole or in part, and 19 | all derivative works of the Software, unless such copies or derivative 20 | works are solely in the form of machine-executable object code generated by 21 | a source language processor. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 26 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 27 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 28 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 29 | DEALINGS IN THE SOFTWARE. 30 | 31 | 2. The MIT License 32 | =============================================================================== 33 | 34 | Copyright (c) 2006, 2007 Marcin Kalicinski 35 | 36 | Permission is hereby granted, free of charge, to any person obtaining a copy 37 | of this software and associated documentation files (the "Software"), to deal 38 | in the Software without restriction, including without limitation the rights 39 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 40 | of the Software, and to permit persons to whom the Software is furnished to do so, 41 | subject to the following conditions: 42 | 43 | The above copyright notice and this permission notice shall be included in all 44 | copies or substantial portions of the Software. 45 | 46 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 47 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 48 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 49 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 50 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 51 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 52 | IN THE SOFTWARE. 53 | -------------------------------------------------------------------------------- /sqlite3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(sqlite3) 4 | 5 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 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 | endif() 10 | 11 | ##################### 12 | # Macro definitions: 13 | 14 | add_definitions( 15 | # -DSOMETHING 16 | ) 17 | 18 | # NDEBUG when release mode: 19 | string(TOLOWER ${CMAKE_BUILD_TYPE} buildType) 20 | if(buildType STREQUAL release) 21 | add_definitions(-DNDEBUG) 22 | endif() 23 | 24 | ######################## 25 | # Include directories: 26 | 27 | include_directories( 28 | "${PROJECT_SOURCE_DIR}" 29 | ) 30 | 31 | ######################## 32 | # Dependency libraries: 33 | 34 | # Static library source files: 35 | add_library(sqlite3 STATIC 36 | sqlite3.c 37 | ) 38 | 39 | ################ 40 | # Installation: 41 | 42 | install( 43 | TARGETS sqlite3 44 | DESTINATION "${PROJECT_SOURCE_DIR}/../build/lib" 45 | ) -------------------------------------------------------------------------------- /sqlite3/sqlite3-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 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sqlite3/sqlite3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------