Reduce includes in plugin/Component.h

This commit is contained in:
Tim Wojtulewicz 2025-04-11 15:17:41 -07:00
parent ff9f0f7a5c
commit c659592773
7 changed files with 27 additions and 17 deletions

View file

@ -4,6 +4,8 @@
#include "zeek/Desc.h"
#include "zeek/Reporter.h"
#include "zeek/Type.h"
#include "zeek/Val.h"
namespace zeek::plugin {
@ -16,6 +18,8 @@ Component::Component(component::Type arg_type, const std::string& arg_name, Tag:
canon_name_val = make_intrusive<StringVal>(canon_name);
}
Component::~Component() {}
void Component::Describe(ODesc* d) const {
d->Add(" ");
d->Add("[");
@ -95,4 +99,7 @@ void Component::SetEnabled(bool arg_enabled) {
break;
}
}
StringValPtr Component::CanonicalNameVal() const { return canon_name_val; }
} // namespace zeek::plugin

View file

@ -2,17 +2,20 @@
#pragma once
#include "zeek/zeek-config.h"
#include <string>
#include "zeek/IntrusivePtr.h"
#include "zeek/Tag.h"
#include "zeek/Type.h"
#include "zeek/Val.h"
namespace zeek {
class ODesc;
class EnumType;
using EnumTypePtr = IntrusivePtr<EnumType>;
class EnumVal;
using EnumValPtr = IntrusivePtr<EnumVal>;
class StringVal;
using StringValPtr = IntrusivePtr<StringVal>;
namespace plugin {
namespace component {
@ -69,7 +72,7 @@ public:
/**
* Destructor.
*/
virtual ~Component() = default;
virtual ~Component();
// Disable.
Component(const Component& other) = delete;
@ -99,7 +102,7 @@ public:
* ID.
*/
const std::string& CanonicalName() const { return canon_name; }
StringValPtr CanonicalNameVal() const { return canon_name_val; }
StringValPtr CanonicalNameVal() const;
/**
* Returns a textual representation of the component. This goes into