Skip to content

Commit d5545b0

Browse files
committed
ipfixprobe - refactor ProcessPlugin
1 parent 0cb8070 commit d5545b0

File tree

5 files changed

+32
-34
lines changed

5 files changed

+32
-34
lines changed

include/ipfixprobe/outputPlugin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "api.hpp"
1717
#include "flowifc.hpp"
1818
#include "plugin.hpp"
19-
#include "process.hpp"
19+
#include "processPlugin.hpp"
2020

2121
#include <cstdint>
2222
#include <string>
Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,22 @@
11
/**
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
268
*
9+
* Copyright (c) 2025 CESNET
2710
*
11+
* SPDX-License-Identifier: BSD-3-Clause
2812
*/
2913

30-
#ifndef IPXP_PROCESS_HPP
31-
#define IPXP_PROCESS_HPP
14+
#pragma once
3215

3316
#include "flowifc.hpp"
3417
#include "packet.hpp"
3518
#include "plugin.hpp"
3619

37-
#include <string>
38-
#include <vector>
39-
4020
namespace ipxp {
4121

4222
/**
@@ -103,5 +83,23 @@ class ProcessPlugin : public Plugin {
10383
virtual void pre_export(Flow& rec) {}
10484
};
10585

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+
106105
} // namespace ipxp
107-
#endif /* IPXP_PROCESS_HPP */

include/ipfixprobe/storagePlugin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "flowifc.hpp"
1818
#include "packet.hpp"
1919
#include "plugin.hpp"
20-
#include "process.hpp"
20+
#include "processPlugin.hpp"
2121
#include "ring.h"
2222

2323
#include <memory>

src/core/ipfixprobe.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include <ipfixprobe/outputPlugin.hpp>
4646
#include <ipfixprobe/packet.hpp>
4747
#include <ipfixprobe/plugin.hpp>
48-
#include <ipfixprobe/process.hpp>
48+
#include <ipfixprobe/processPlugin.hpp>
4949
#include <ipfixprobe/ring.h>
5050
#include <ipfixprobe/storagePlugin.hpp>
5151
#include <ipfixprobe/utils.hpp>

src/core/workers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <ipfixprobe/inputPlugin.hpp>
3838
#include <ipfixprobe/outputPlugin.hpp>
3939
#include <ipfixprobe/packet.hpp>
40-
#include <ipfixprobe/process.hpp>
40+
#include <ipfixprobe/processPlugin.hpp>
4141
#include <ipfixprobe/ring.h>
4242
#include <ipfixprobe/storagePlugin.hpp>
4343

0 commit comments

Comments
 (0)