mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00

- Move more functionality into base class. - Remove cctors and assignment operators (weren't actually needed anymore) - Switch from const char* to std::string.
37 lines
821 B
C++
37 lines
821 B
C++
// See the file "COPYING" in the main distribution directory for copyright.
|
|
|
|
#include "Component.h"
|
|
#include "Manager.h"
|
|
|
|
#include "../Desc.h"
|
|
#include "../util.h"
|
|
|
|
using namespace analyzer;
|
|
|
|
Component::Component(const std::string& name, factory_callback arg_factory, Tag::subtype_t arg_subtype, bool arg_enabled, bool arg_partial)
|
|
: plugin::Component(plugin::component::ANALYZER, name),
|
|
plugin::TaggedComponent<analyzer::Tag>(arg_subtype)
|
|
{
|
|
canon_name = canonify_name(name);
|
|
factory = arg_factory;
|
|
enabled = arg_enabled;
|
|
partial = arg_partial;
|
|
|
|
analyzer_mgr->RegisterComponent(this, "ANALYZER_");
|
|
}
|
|
|
|
Component::~Component()
|
|
{
|
|
}
|
|
|
|
void Component::DoDescribe(ODesc* d) const
|
|
{
|
|
if ( factory )
|
|
{
|
|
d->Add("ANALYZER_");
|
|
d->Add(canon_name);
|
|
d->Add(", ");
|
|
}
|
|
|
|
d->Add(enabled ? "enabled" : "disabled");
|
|
}
|