Skip to content

Commit 57163d4

Browse files
authored
cleanup (#2)
* cleanup * removed references to non-existing example * adding badge * typos * typos * remove #prama once * formated
1 parent cd5fc3b commit 57163d4

File tree

5 files changed

+16
-22
lines changed

5 files changed

+16
-22
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
# xplugin
2+
3+
[![ci](https://github.com/QuantStack/xplugin/actions/workflows/ci.yaml/badge.svg)](https://github.com/QuantStack/xplugin/actions/workflows/ci.yaml)
4+
25
Generic plugin framework in C++.
36

47
## Features
58

69
- [x] Generic plugin framework
7-
- [x] Abitrary abstract base classes can be used as plugin interface
10+
- [x] Arbitrary abstract base classes can be used as plugin interface
811
- [x] Customizable with custom plugin factories (see examples)
9-
- [x] Works on Linux, Mac and Windows and emscripten
12+
- [x] Works on linux, mac, windows and emscripten
1013

1114
## Usage
1215

1316
## Example 1
1417

15-
All plugins are derived from a a base class, in the first example `MyPluginBase`.
18+
All plugins are derived from a base class, in the first example `MyPluginBase`.
1619
All concrete plugins are derived from `MyPluginBase` and implement the pure virtual function (in this example it is only the `do_something()` function).
1720
Furthermore, for this example, we assume that all concrete plugins have an empty constructor.
1821
(see example 2 for a more complex example)
@@ -114,7 +117,7 @@ int main(int argc, char** argv)
114117
115118
We again define a plugin interface `MyOtherPluginBase` and a concrete plugin implementations `MyOtherPluginA` and `MyOtherPluginB`.
116119
The difference to the first example is that the concrete plugins have a constructor with arguments.
117-
But both plugins have the same constructor signature. (see example 3 for a more complex example)
120+
But both plugins have the same constructor signature.
118121
119122
`my_other_plugin_base.hpp`:
120123
```cpp

docs/conf.py.in

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ project = 'xplugin'
1010
copyright = '2023, Dr. Thorsten Beier and Johan Mabille'
1111
author = 'Dr. Thorsten Beier and Johan Mabille'
1212

13-
14-
1513
# -- General configuration ---------------------------------------------------
1614
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1715

@@ -28,13 +26,9 @@ extensions = [
2826
'breathe'
2927
]
3028

31-
32-
3329
templates_path = ['_templates']
3430
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'breathe/*']
3531

36-
37-
3832
# -- Options for HTML output -------------------------------------------------
3933
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4034

@@ -59,13 +53,11 @@ html_theme_options = {
5953
'titles_only': False
6054
}
6155
# html_logo = ''
62-
# github_url = ''
63-
#html_baseurl = 'baZINGA'
64-
56+
github_url = 'https://github.com/QuantStack/xplugin'
57+
# html_baseurl = ''
6558

6659
html_static_path = []
6760

68-
6961
# -- Breathe configuration -------------------------------------------------
7062
from pathlib import Path
7163
CMAKE_CURRENT_BINARY_DIR = Path("@CMAKE_CURRENT_BINARY_DIR@")

examples/custom_factory_with_metadata/custom_factory_with_metadata_plugin_base.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#pragma once
1+
#ifndef CUSTOM_FACTORY_WITH_METADATA_PLUGIN_BASE_HPP
2+
#define CUSTOM_FACTORY_WITH_METADATA_PLUGIN_BASE_HPP
3+
24
#include <string>
35

46
class PluginBase
@@ -24,3 +26,5 @@ class PluginFactoryBase
2426
virtual std::string description() const = 0;
2527
virtual std::string version() const = 0;
2628
};
29+
30+
#endif // CUSTOM_FACTORY_WITH_METADATA_PLUGIN_BASE_HPP

include/xplugin/xfactory.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ class xfactory_base
2727
{
2828
public:
2929
using base_type = BASE_TYPE;
30-
virtual ~xfactory_base()
31-
{
32-
}
30+
virtual ~xfactory_base() = default;
3331
virtual std::unique_ptr<base_type> create(ARGS...) = 0;
3432
};
3533

@@ -41,9 +39,7 @@ class xfactory : public xfactory_base<BASE_TYPE, ARGS...>
4139
using concrete_type = CONCRETE_TYPE;
4240
using base_type = BASE_TYPE;
4341
using factory_base_type = xfactory_base<BASE_TYPE, ARGS...>;
44-
virtual ~xfactory()
45-
{
46-
}
42+
virtual ~xfactory() = default;
4743
std::unique_ptr<base_type> create(ARGS... args) override;
4844
};
4945

include/xplugin/xshared_library.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* *
77
* The full license is in the file LICENSE, distributed with this software. *
88
****************************************************************************/
9-
#pragma once
109
#ifndef XPLUGIN_XSHARED_LIBRARY_HPP
1110
#define XPLUGIN_XSHARED_LIBRARY_HPP
1211

0 commit comments

Comments
 (0)