11/* *
2- * \file storage.hpp
3- * \brief Generic interface of storage 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 storage plugin
4+ * @author Pavel Siska <[email protected] > 5+ * @author Vaclav Bartos <[email protected] > 6+ * @author Jiri Havranek <[email protected] > 7+ * @date 2025
268 *
9+ * Copyright (c) 2025 CESNET
2710 *
11+ * SPDX-License-Identifier: BSD-3-Clause
2812 */
2913
30- #ifndef IPXP_STORAGE_HPP
31- #define IPXP_STORAGE_HPP
14+ #pragma once
3215
16+ #include " api.hpp"
3317#include " flowifc.hpp"
3418#include " packet.hpp"
3519#include " plugin.hpp"
@@ -46,14 +30,7 @@ namespace ipxp {
4630/* *
4731 * \brief Base class for flow caches.
4832 */
49- class StoragePlugin : public Plugin {
50- protected:
51- ipx_ring_t * m_export_queue;
52-
53- private:
54- ProcessPlugin** m_plugins; /* *< Array of plugins. */
55- uint32_t m_plugin_cnt;
56-
33+ class IPXP_API StoragePlugin : public Plugin {
5734public:
5835 StoragePlugin ()
5936 : m_export_queue(nullptr )
@@ -186,7 +163,31 @@ class StoragePlugin : public Plugin {
186163 m_plugins[i]->pre_export (rec);
187164 }
188165 }
166+
167+ ipx_ring_t * m_export_queue;
168+
169+ private:
170+ ProcessPlugin** m_plugins; /* *< Array of plugins. */
171+ uint32_t m_plugin_cnt;
189172};
190173
174+ /* *
175+ * @brief Factory template for creating plugins.
176+ *
177+ * This template allows dynamic creation of plugin instances based on the specified
178+ * base class and constructor argument types.
179+ *
180+ * @tparam Base The base class for the plugin.
181+ * @tparam Args The argument types required for the plugin constructor.
182+ */
183+ template <typename Base, typename ... Args>
184+ class IPXP_API PluginFactory;
185+
186+ /* *
187+ * @brief Type alias for the StoragePlugin factory.
188+ *
189+ * Provides a factory for creating StoragePlugin instances using a string-based constructor.
190+ */
191+ using StoragePluginFactory = PluginFactory<StoragePlugin, const std::string&>;
192+
191193} // namespace ipxp
192- #endif /* IPXP_STORAGE_HPP */
0 commit comments