mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
Deprecate file analyzer construction methods taking raw RecordVal*
Replaced with versions that instead take IntrusivePtr
This commit is contained in:
parent
ecb7c7c27e
commit
57a6069cd1
26 changed files with 164 additions and 79 deletions
|
@ -14,6 +14,7 @@ namespace file_analysis {
|
|||
|
||||
class File;
|
||||
class Analyzer;
|
||||
class Manager;
|
||||
|
||||
/**
|
||||
* Component description for plugins providing file analyzers.
|
||||
|
@ -25,6 +26,7 @@ class Component : public plugin::Component,
|
|||
public plugin::TaggedComponent<file_analysis::Tag> {
|
||||
public:
|
||||
typedef Analyzer* (*factory_callback)(RecordVal* args, File* file);
|
||||
using factory_function = Analyzer* (*)(IntrusivePtr<RecordVal> args, File* file);
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -45,6 +47,9 @@ public:
|
|||
* analyzer instances can accordingly access it via analyzer::Tag().
|
||||
* If not used, leave at zero.
|
||||
*/
|
||||
Component(const std::string& name, factory_function factory, Tag::subtype_t subtype = 0);
|
||||
|
||||
[[deprecated("Remove in v4.1. Use factory_function w/ IntrusivePtr args")]]
|
||||
Component(const std::string& name, factory_callback factory, Tag::subtype_t subtype = 0);
|
||||
|
||||
/**
|
||||
|
@ -62,6 +67,10 @@ public:
|
|||
/**
|
||||
* Returns the analyzer's factory function.
|
||||
*/
|
||||
factory_function FactoryFunction() const
|
||||
{ return factory_func; }
|
||||
|
||||
[[deprecated("Remove in v4.1. Use FactoryFunction().")]]
|
||||
factory_callback Factory() const { return factory; }
|
||||
|
||||
protected:
|
||||
|
@ -71,7 +80,10 @@ protected:
|
|||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
private:
|
||||
factory_callback factory; // The analyzer's factory callback.
|
||||
friend class file_analysis::Manager;
|
||||
|
||||
factory_callback factory; // The analyzer's factory callback (deprecated).
|
||||
factory_function factory_func; // The analyzer's factory callback.
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue