From c659592773377f4ce87dcc75143b3b0d6f174d36 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 11 Apr 2025 15:17:41 -0700 Subject: [PATCH] Reduce includes in plugin/Component.h --- src/cluster/Backend.h | 12 +++--------- src/iosource/Component.cc | 1 + src/plugin/Component.cc | 7 +++++++ src/plugin/Component.h | 15 +++++++++------ src/storage/Component.h | 3 +++ src/zeekygen/Configuration.cc | 1 + .../btest/plugins/iosource-plugin/src/Plugin.h | 5 +++-- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/cluster/Backend.h b/src/cluster/Backend.h index b8a5a11143..c3506cc3e2 100644 --- a/src/cluster/Backend.h +++ b/src/cluster/Backend.h @@ -10,22 +10,16 @@ #include #include "zeek/EventHandler.h" -#include "zeek/IntrusivePtr.h" #include "zeek/Span.h" #include "zeek/Tag.h" +#include "zeek/Val.h" +#include "zeek/ZeekArgs.h" +#include "zeek/cluster/BifSupport.h" #include "zeek/cluster/Serializer.h" #include "zeek/logging/Types.h" namespace zeek { -class FuncVal; - -using FuncValPtr = IntrusivePtr; - -class Val; -using ValPtr = IntrusivePtr; -using ArgsSpan = Span; - namespace detail { template class OnLoopProcess; diff --git a/src/iosource/Component.cc b/src/iosource/Component.cc index 80e792ff91..3aa7610e0b 100644 --- a/src/iosource/Component.cc +++ b/src/iosource/Component.cc @@ -4,6 +4,7 @@ #include "zeek/Desc.h" #include "zeek/Reporter.h" +#include "zeek/Type.h" namespace zeek::iosource { diff --git a/src/plugin/Component.cc b/src/plugin/Component.cc index fda9bde98d..e363066dfd 100644 --- a/src/plugin/Component.cc +++ b/src/plugin/Component.cc @@ -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(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 diff --git a/src/plugin/Component.h b/src/plugin/Component.h index 62f11b0cb9..9a28d21a0d 100644 --- a/src/plugin/Component.h +++ b/src/plugin/Component.h @@ -2,17 +2,20 @@ #pragma once -#include "zeek/zeek-config.h" - #include +#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; +class EnumVal; +using EnumValPtr = IntrusivePtr; +class StringVal; +using StringValPtr = IntrusivePtr; 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 diff --git a/src/storage/Component.h b/src/storage/Component.h index d7768b1d1a..e93fbf114f 100644 --- a/src/storage/Component.h +++ b/src/storage/Component.h @@ -2,6 +2,9 @@ #pragma once +#include + +#include "zeek/IntrusivePtr.h" #include "zeek/plugin/Component.h" namespace zeek::storage { diff --git a/src/zeekygen/Configuration.cc b/src/zeekygen/Configuration.cc index 035d58bc39..021bfd0982 100644 --- a/src/zeekygen/Configuration.cc +++ b/src/zeekygen/Configuration.cc @@ -8,6 +8,7 @@ #include #include "zeek/Reporter.h" +#include "zeek/Type.h" #include "zeek/zeekygen/utils.h" using namespace std; diff --git a/testing/btest/plugins/iosource-plugin/src/Plugin.h b/testing/btest/plugins/iosource-plugin/src/Plugin.h index a0d9575008..11bbf15053 100644 --- a/testing/btest/plugins/iosource-plugin/src/Plugin.h +++ b/testing/btest/plugins/iosource-plugin/src/Plugin.h @@ -1,11 +1,12 @@ #pragma once -#include -#include #include #include +#include "zeek/Flare.h" +#include "zeek/RunState.h" #include "zeek/iosource/Manager.h" +#include "zeek/plugin/Plugin.h" namespace btest::plugin::Demo_Iosource {