mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Improve TableVal HashKey management
* Deprecated ComputeHash() methods and replaced with MakeHashKey() which returns std::unique_ptr<HashKey> * Deprecated RecoverIndex() and replaced with RecreateIndex() which takes HashKey& and returns IntrusivePtr. * Updated the new TableVal Assign()/Remove() methods to take either std::unique_ptr<HashKey> or HashKey& as appropriate for clarity of ownership expectations.
This commit is contained in:
parent
8a6a92c348
commit
3f92df51b7
18 changed files with 137 additions and 114 deletions
13
src/IPAddr.h
13
src/IPAddr.h
|
@ -6,6 +6,7 @@
|
|||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
#include "threading/SerialTypes.h"
|
||||
|
||||
|
@ -247,9 +248,11 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a key that can be used to lookup the IP Address in a hash
|
||||
* table. Passes ownership to caller.
|
||||
* Returns a key that can be used to lookup the IP Address in a hash table.
|
||||
*/
|
||||
std::unique_ptr<HashKey> MakeHashKey() const;
|
||||
|
||||
[[deprecated("Remove in v4.1. Use MakeHashKey().")]]
|
||||
HashKey* GetHashKey() const;
|
||||
|
||||
/**
|
||||
|
@ -629,9 +632,11 @@ public:
|
|||
operator std::string() const { return AsString(); }
|
||||
|
||||
/**
|
||||
* Returns a key that can be used to lookup the IP Prefix in a hash
|
||||
* table. Passes ownership to caller.
|
||||
* Returns a key that can be used to lookup the IP Prefix in a hash table.
|
||||
*/
|
||||
std::unique_ptr<HashKey> MakeHashKey() const;
|
||||
|
||||
[[deprecated("Remove in v4.1. Use MakeHashKey().")]]
|
||||
HashKey* GetHashKey() const;
|
||||
|
||||
/** Converts the prefix into the type used internally by the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue