Val: forward-declare class PDict, reduce includes

This commit is contained in:
Max Kellermann 2020-02-11 10:32:46 +01:00
parent dfac4572e7
commit 4aac78cf29
6 changed files with 14 additions and 2 deletions

View file

@ -3,6 +3,7 @@
#include "zeek-config.h"
#include "CompHash.h"
#include "Dict.h"
#include "Val.h"
#include "Reporter.h"
#include "Func.h"

View file

@ -14,6 +14,7 @@
#include <stdlib.h>
#include "Attr.h"
#include "Dict.h"
#include "Net.h"
#include "File.h"
#include "Func.h"
@ -1357,6 +1358,11 @@ void TableVal::RemoveAll()
val.table_val->SetDeleteFunc(table_entry_val_delete_func);
}
int TableVal::Size() const
{
return AsTable()->Length();
}
int TableVal::RecursiveSize() const
{
int n = AsTable()->Length();

View file

@ -3,7 +3,6 @@
#pragma once
#include "Type.h"
#include "Dict.h"
#include "CompHash.h"
#include "BroString.h"
#include "Timer.h"
@ -31,6 +30,9 @@ using std::string;
#define UDP_PORT_MASK 0x20000
#define ICMP_PORT_MASK 0x30000
template<typename T> class PDict;
class IterCookie;
class Val;
class BroFunc;
class Func;
@ -786,7 +788,7 @@ public:
Attributes* Attrs() { return attrs; }
// Returns the size of the table.
int Size() const { return AsTable()->Length(); }
int Size() const;
int RecursiveSize() const;
// Returns the Prefix table used inside the table (if present).

View file

@ -9,6 +9,7 @@
#include "IntrusivePtr.h"
#include "Reporter.h"
#include "NetVar.h"
#include "Dict.h"
namespace probabilistic {

View file

@ -13,6 +13,7 @@
#include <sstream>
#include "iosource/Manager.h"
#include "Dict.h"
#include "Reporter.h"
#include "Scope.h"
#include "DebugLogger.h"

View file

@ -44,6 +44,7 @@
#endif
#include "Desc.h"
#include "Dict.h"
#include "digest.h"
#include "input.h"
#include "Obj.h"