mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Convert Dictionary types to be templated classes
This has the fortunate side-effect of also making it so we can store the value objects as typed pointers, instead of void*.
This commit is contained in:
parent
15c0bd9b9d
commit
47e7fe2cd1
15 changed files with 1153 additions and 1284 deletions
|
@ -96,7 +96,8 @@ public:
|
|||
void DrainModifications();
|
||||
|
||||
// Iterator support
|
||||
using iterator = zeek::DictIterator;
|
||||
using iterator = zeek::DictIterator<file_analysis::Analyzer>;
|
||||
;
|
||||
using const_iterator = const iterator;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
|
|
|
@ -377,7 +377,7 @@ void File::DeliverStream(const u_char* data, uint64_t len)
|
|||
|
||||
for ( const auto& entry : analyzers )
|
||||
{
|
||||
auto* a = entry.GetValue<file_analysis::Analyzer*>();
|
||||
auto* a = entry.value;
|
||||
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "stream delivery to analyzer %s",
|
||||
file_mgr->GetComponentName(a->Tag()).c_str());
|
||||
|
@ -475,7 +475,7 @@ void File::DeliverChunk(const u_char* data, uint64_t len, uint64_t offset)
|
|||
|
||||
for ( const auto& entry : analyzers )
|
||||
{
|
||||
auto* a = entry.GetValue<file_analysis::Analyzer*>();
|
||||
auto* a = entry.value;
|
||||
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "chunk delivery to analyzer %s",
|
||||
file_mgr->GetComponentName(a->Tag()).c_str());
|
||||
|
@ -539,7 +539,7 @@ void File::EndOfFile()
|
|||
|
||||
for ( const auto& entry : analyzers )
|
||||
{
|
||||
auto* a = entry.GetValue<file_analysis::Analyzer*>();
|
||||
auto* a = entry.value;
|
||||
|
||||
if ( ! a->EndOfFile() )
|
||||
analyzers.QueueRemove(a->Tag(), a->GetArgs());
|
||||
|
@ -574,7 +574,7 @@ void File::Gap(uint64_t offset, uint64_t len)
|
|||
|
||||
for ( const auto& entry : analyzers )
|
||||
{
|
||||
auto* a = entry.GetValue<file_analysis::Analyzer*>();
|
||||
auto* a = entry.value;
|
||||
|
||||
if ( ! a->Undelivered(offset, len) )
|
||||
analyzers.QueueRemove(a->Tag(), a->GetArgs());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue