From 683c8da3be573d4857ba9cf0a69228607088ed32 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Tue, 1 Aug 2023 19:50:05 +0200 Subject: [PATCH 1/7] cleanup --- docs/conf.py.in | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/conf.py.in b/docs/conf.py.in index b223135..055f09c 100644 --- a/docs/conf.py.in +++ b/docs/conf.py.in @@ -10,8 +10,6 @@ project = 'xplugin' copyright = '2023, Dr. Thorsten Beier and Johan Mabille' author = 'Dr. Thorsten Beier and Johan Mabille' - - # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -28,13 +26,9 @@ extensions = [ 'breathe' ] - - templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'breathe/*'] - - # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output @@ -59,13 +53,11 @@ html_theme_options = { 'titles_only': False } # html_logo = '' -# github_url = '' -#html_baseurl = 'baZINGA' - +github_url = 'https://github.com/QuantStack/xplugin' +# html_baseurl = '' html_static_path = [] - # -- Breathe configuration ------------------------------------------------- from pathlib import Path CMAKE_CURRENT_BINARY_DIR = Path("@CMAKE_CURRENT_BINARY_DIR@") From 263ccf8d6cc2eb5be0f6e6dbc8398900ac3dd0e9 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Tue, 1 Aug 2023 19:51:56 +0200 Subject: [PATCH 2/7] removed references to non-existing example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9389c91..167282d 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ int main(int argc, char** argv) We again define a plugin interface `MyOtherPluginBase` and a concrete plugin implementations `MyOtherPluginA` and `MyOtherPluginB`. The difference to the first example is that the concrete plugins have a constructor with arguments. -But both plugins have the same constructor signature. (see example 3 for a more complex example) +But both plugins have the same constructor signature. `my_other_plugin_base.hpp`: ```cpp From 4627151f00bdbf10472da3b029a98fc6e96a6efa Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Tue, 1 Aug 2023 19:54:32 +0200 Subject: [PATCH 3/7] adding badge --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 167282d..57b1269 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # xplugin + +[![ci](https://github.com/QuantStack/xplugin/actions/workflows/ci.yaml/badge.svg)](https://github.com/QuantStack/xplugin/actions/workflows/ci.yaml) + Generic plugin framework in C++. ## Features From 4d14583c129d7eff32f3791b4e6380a8df66727b Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Tue, 1 Aug 2023 19:55:43 +0200 Subject: [PATCH 4/7] typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 57b1269..0bb6a11 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Generic plugin framework in C++. ## Features - [x] Generic plugin framework -- [x] Abitrary abstract base classes can be used as plugin interface +- [x] Arbitrary abstract base classes can be used as plugin interface - [x] Customizable with custom plugin factories (see examples) -- [x] Works on Linux, Mac and Windows and emscripten +- [x] Works on linux, mac, windows and emscripten ## Usage From 53a75e8fa32351eca2be4febad907277ea223ace Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Tue, 1 Aug 2023 19:56:06 +0200 Subject: [PATCH 5/7] typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bb6a11..2b8b1d4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Generic plugin framework in C++. ## Example 1 -All plugins are derived from a a base class, in the first example `MyPluginBase`. +All plugins are derived from a base class, in the first example `MyPluginBase`. All concrete plugins are derived from `MyPluginBase` and implement the pure virtual function (in this example it is only the `do_something()` function). Furthermore, for this example, we assume that all concrete plugins have an empty constructor. (see example 2 for a more complex example) From 37104d959e91619dc8efa694394aa09e4521fd2d Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Tue, 1 Aug 2023 19:57:43 +0200 Subject: [PATCH 6/7] remove #prama once --- .../custom_factory_with_metadata_plugin_base.hpp | 6 +++++- include/xplugin/xshared_library.hpp | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/custom_factory_with_metadata/custom_factory_with_metadata_plugin_base.hpp b/examples/custom_factory_with_metadata/custom_factory_with_metadata_plugin_base.hpp index d8af6fe..040e75d 100644 --- a/examples/custom_factory_with_metadata/custom_factory_with_metadata_plugin_base.hpp +++ b/examples/custom_factory_with_metadata/custom_factory_with_metadata_plugin_base.hpp @@ -1,4 +1,6 @@ -#pragma once +#ifndef CUSTOM_FACTORY_WITH_METADATA_PLUGIN_BASE_HPP +#define CUSTOM_FACTORY_WITH_METADATA_PLUGIN_BASE_HPP + #include class PluginBase @@ -24,3 +26,5 @@ class PluginFactoryBase virtual std::string description() const = 0; virtual std::string version() const = 0; }; + +#endif // CUSTOM_FACTORY_WITH_METADATA_PLUGIN_BASE_HPP diff --git a/include/xplugin/xshared_library.hpp b/include/xplugin/xshared_library.hpp index b2f12aa..ef63bad 100644 --- a/include/xplugin/xshared_library.hpp +++ b/include/xplugin/xshared_library.hpp @@ -6,7 +6,6 @@ * * * The full license is in the file LICENSE, distributed with this software. * ****************************************************************************/ -#pragma once #ifndef XPLUGIN_XSHARED_LIBRARY_HPP #define XPLUGIN_XSHARED_LIBRARY_HPP From 8f4e24a8c0afd90110953a10ce8986983e71f063 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 2 Aug 2023 08:33:24 +0200 Subject: [PATCH 7/7] formated --- include/xplugin/xfactory.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/xplugin/xfactory.hpp b/include/xplugin/xfactory.hpp index 8f9bad4..0b53f5e 100644 --- a/include/xplugin/xfactory.hpp +++ b/include/xplugin/xfactory.hpp @@ -27,9 +27,7 @@ class xfactory_base { public: using base_type = BASE_TYPE; - virtual ~xfactory_base() - { - } + virtual ~xfactory_base() = default; virtual std::unique_ptr create(ARGS...) = 0; }; @@ -41,9 +39,7 @@ class xfactory : public xfactory_base using concrete_type = CONCRETE_TYPE; using base_type = BASE_TYPE; using factory_base_type = xfactory_base; - virtual ~xfactory() - { - } + virtual ~xfactory() = default; std::unique_ptr create(ARGS... args) override; };