|
1 | 1 | /** |
2 | | - * \file process.hpp |
3 | | - * \brief Generic interface of processing plugin |
4 | | - * \author Vaclav Bartos <[email protected]> |
5 | | - * \author Jiri Havranek <[email protected]> |
6 | | - * \date 2021 |
7 | | - */ |
8 | | -/* |
9 | | - * Copyright (C) 2021 CESNET |
10 | | - * |
11 | | - * LICENSE TERMS |
12 | | - * |
13 | | - * Redistribution and use in source and binary forms, with or without |
14 | | - * modification, are permitted provided that the following conditions |
15 | | - * are met: |
16 | | - * 1. Redistributions of source code must retain the above copyright |
17 | | - * notice, this list of conditions and the following disclaimer. |
18 | | - * 2. Redistributions in binary form must reproduce the above copyright |
19 | | - * notice, this list of conditions and the following disclaimer in |
20 | | - * the documentation and/or other materials provided with the |
21 | | - * distribution. |
22 | | - * 3. Neither the name of the Company nor the names of its contributors |
23 | | - * may be used to endorse or promote products derived from this |
24 | | - * software without specific prior written permission. |
25 | | - * |
| 2 | + * @file |
| 3 | + * @brief Generic interface of processing plugin |
| 4 | + * @author Pavel Siska <[email protected]> |
| 5 | + * @author Vaclav Bartos <[email protected]> |
| 6 | + * @author Jiri Havranek <[email protected]> |
| 7 | + * @date 2025 |
26 | 8 | * |
| 9 | + * Copyright (c) 2025 CESNET |
27 | 10 | * |
| 11 | + * SPDX-License-Identifier: BSD-3-Clause |
28 | 12 | */ |
29 | 13 |
|
30 | | -#ifndef IPXP_PROCESS_HPP |
31 | | -#define IPXP_PROCESS_HPP |
| 14 | +#pragma once |
32 | 15 |
|
33 | 16 | #include "flowifc.hpp" |
34 | 17 | #include "packet.hpp" |
35 | 18 | #include "plugin.hpp" |
36 | 19 |
|
37 | | -#include <string> |
38 | | -#include <vector> |
39 | | - |
40 | 20 | namespace ipxp { |
41 | 21 |
|
42 | 22 | /** |
@@ -103,5 +83,23 @@ class ProcessPlugin : public Plugin { |
103 | 83 | virtual void pre_export(Flow& rec) {} |
104 | 84 | }; |
105 | 85 |
|
| 86 | +/** |
| 87 | + * @brief Factory template for creating plugins. |
| 88 | + * |
| 89 | + * This template allows dynamic creation of plugin instances based on the specified |
| 90 | + * base class and constructor argument types. |
| 91 | + * |
| 92 | + * @tparam Base The base class for the plugin. |
| 93 | + * @tparam Args The argument types required for the plugin constructor. |
| 94 | + */ |
| 95 | +template<typename Base, typename... Args> |
| 96 | +class IPXP_API PluginFactory; |
| 97 | + |
| 98 | +/** |
| 99 | + * @brief Type alias for the ProcessPlugin factory. |
| 100 | + * |
| 101 | + * Provides a factory for creating ProcessPlugin instances using a string-based constructor. |
| 102 | + */ |
| 103 | +using ProcessPluginFactory = PluginFactory<ProcessPlugin, const std::string&>; |
| 104 | + |
106 | 105 | } // namespace ipxp |
107 | | -#endif /* IPXP_PROCESS_HPP */ |
0 commit comments