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

@ -10,22 +10,16 @@
#include <variant>
#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<FuncVal>;
class Val;
using ValPtr = IntrusivePtr<Val>;
using ArgsSpan = Span<const ValPtr>;
namespace detail {
template<class Proc, class Work>
class OnLoopProcess;

View file

@ -4,6 +4,7 @@
#include "zeek/Desc.h"
#include "zeek/Reporter.h"
#include "zeek/Type.h"
namespace zeek::iosource {

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

View file

@ -2,6 +2,9 @@
#pragma once
#include <memory>
#include "zeek/IntrusivePtr.h"
#include "zeek/plugin/Component.h"
namespace zeek::storage {

View file

@ -8,6 +8,7 @@
#include <vector>
#include "zeek/Reporter.h"
#include "zeek/Type.h"
#include "zeek/zeekygen/utils.h"
using namespace std;

View file

@ -1,11 +1,12 @@
#pragma once
#include <zeek/Flare.h>
#include <zeek/plugin/Plugin.h>
#include <string>
#include <string_view>
#include "zeek/Flare.h"
#include "zeek/RunState.h"
#include "zeek/iosource/Manager.h"
#include "zeek/plugin/Plugin.h"
namespace btest::plugin::Demo_Iosource {