mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Refactor Analyzer::AddChildAnalyzer and usages.
Make feedback available regarding whether adding a child analyzer fails because one of the same type already exists (so one can avoid invalid pointer access of a delete'd analyzer).
This commit is contained in:
parent
bb8f102b2c
commit
a3b963ad4e
4 changed files with 19 additions and 15 deletions
|
@ -353,9 +353,10 @@ public:
|
|||
* discarded.
|
||||
*
|
||||
* @param analyzer The ananlyzer to add. Takes ownership.
|
||||
* @return false if analyzer type was already a child, else true.
|
||||
*/
|
||||
void AddChildAnalyzer(Analyzer* analyzer)
|
||||
{ AddChildAnalyzer(analyzer, true); }
|
||||
bool AddChildAnalyzer(Analyzer* analyzer)
|
||||
{ return AddChildAnalyzer(analyzer, true); }
|
||||
|
||||
/**
|
||||
* Adds a new child analyzer to the analyzer tree. If an analyzer of
|
||||
|
@ -363,6 +364,7 @@ public:
|
|||
* discarded.
|
||||
*
|
||||
* @param tag The type of analyzer to add.
|
||||
* @return the new analyzer instance that was added.
|
||||
*/
|
||||
Analyzer* AddChildAnalyzer(Tag tag);
|
||||
|
||||
|
@ -600,8 +602,9 @@ protected:
|
|||
* @param analyzer The analyzer to add. Takes ownership.
|
||||
*
|
||||
* @param init If true, Init() will be calle.d
|
||||
* @return false if analyzer type was already a child, else true.
|
||||
*/
|
||||
void AddChildAnalyzer(Analyzer* analyzer, bool init);
|
||||
bool AddChildAnalyzer(Analyzer* analyzer, bool init);
|
||||
|
||||
/**
|
||||
* Inits all child analyzers. This is an internal method.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue