mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Unify plugin::Component and plugin::TaggedComponent into a single class
These two are almost always used in conjunction with each other, and TaggedComponent is never used by itself. Combining them together into a single class will help simplify some of the code around managing the mapping between Tags and Components.
This commit is contained in:
parent
8b544d648d
commit
7d66f4252f
18 changed files with 90 additions and 158 deletions
|
@ -9,9 +9,8 @@ using namespace zeek::packet_analysis;
|
|||
|
||||
Component::Component(const std::string& name, factory_callback arg_factory,
|
||||
Tag::subtype_t arg_subtype)
|
||||
: plugin::Component(plugin::component::PACKET_ANALYZER, name), plugin::TaggedComponent(
|
||||
arg_subtype,
|
||||
packet_mgr->GetTagType())
|
||||
: plugin::Component(plugin::component::PACKET_ANALYZER, name, arg_subtype,
|
||||
packet_mgr->GetTagType())
|
||||
{
|
||||
factory = arg_factory;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "zeek/Tag.h"
|
||||
#include "zeek/plugin/Component.h"
|
||||
#include "zeek/plugin/TaggedComponent.h"
|
||||
#include "zeek/util.h"
|
||||
|
||||
namespace zeek::packet_analysis
|
||||
|
@ -17,7 +16,7 @@ namespace zeek::packet_analysis
|
|||
class Analyzer;
|
||||
using AnalyzerPtr = std::shared_ptr<Analyzer>;
|
||||
|
||||
class Component : public plugin::Component, public plugin::TaggedComponent
|
||||
class Component : public plugin::Component
|
||||
{
|
||||
public:
|
||||
using factory_callback = std::function<AnalyzerPtr()>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue