mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Val: Move TablePatternMatcher into detail namespace
There's anyway only prototype in the headers, so detail seems better than the public zeek namespace.
This commit is contained in:
parent
43a5473919
commit
c426304c27
2 changed files with 6 additions and 9 deletions
10
src/Val.cc
10
src/Val.cc
|
@ -1427,11 +1427,9 @@ static void find_nested_record_types(const TypePtr& t, std::set<RecordType*>* fo
|
|||
}
|
||||
}
|
||||
|
||||
using PatternValPtr = IntrusivePtr<PatternVal>;
|
||||
|
||||
// Support class for returning multiple values from a table[pattern]
|
||||
// when indexed with a string.
|
||||
class TablePatternMatcher {
|
||||
class detail::TablePatternMatcher {
|
||||
public:
|
||||
TablePatternMatcher(const TableVal* _tbl, TypePtr _yield) : tbl(_tbl) {
|
||||
vtype = make_intrusive<VectorType>(std::move(_yield));
|
||||
|
@ -1465,7 +1463,7 @@ private:
|
|||
std::vector<ValPtr> matcher_yields;
|
||||
};
|
||||
|
||||
VectorValPtr TablePatternMatcher::Lookup(const StringVal* s) {
|
||||
VectorValPtr detail::TablePatternMatcher::Lookup(const StringVal* s) {
|
||||
auto results = make_intrusive<VectorVal>(vtype);
|
||||
|
||||
if ( ! matcher ) {
|
||||
|
@ -1484,7 +1482,7 @@ VectorValPtr TablePatternMatcher::Lookup(const StringVal* s) {
|
|||
return results;
|
||||
}
|
||||
|
||||
void TablePatternMatcher::Build() {
|
||||
void detail::TablePatternMatcher::Build() {
|
||||
matcher_yields.clear();
|
||||
matcher_yields.push_back(nullptr);
|
||||
|
||||
|
@ -1544,7 +1542,7 @@ void TableVal::Init(TableTypePtr t, bool ordered) {
|
|||
subnets = nullptr;
|
||||
|
||||
if ( table_type->IsPatternIndex() && table_type->Yield() )
|
||||
pattern_matcher = new TablePatternMatcher(this, table_type->Yield());
|
||||
pattern_matcher = new detail::TablePatternMatcher(this, table_type->Yield());
|
||||
|
||||
table_hash = new detail::CompositeHash(table_type->GetIndices());
|
||||
if ( ordered )
|
||||
|
|
|
@ -51,6 +51,7 @@ class Frame;
|
|||
class PrefixTable;
|
||||
class CompositeHash;
|
||||
class HashKey;
|
||||
class TablePatternMatcher;
|
||||
|
||||
class ValTrace;
|
||||
class ZBody;
|
||||
|
@ -718,8 +719,6 @@ protected:
|
|||
TableVal* table;
|
||||
};
|
||||
|
||||
class TablePatternMatcher;
|
||||
|
||||
class TableVal final : public Val, public notifier::detail::Modifiable {
|
||||
public:
|
||||
explicit TableVal(TableTypePtr t, detail::AttributesPtr attrs = nullptr);
|
||||
|
@ -1039,7 +1038,7 @@ protected:
|
|||
TableValTimer* timer;
|
||||
RobustDictIterator<TableEntryVal>* expire_iterator;
|
||||
detail::PrefixTable* subnets;
|
||||
TablePatternMatcher* pattern_matcher = nullptr;
|
||||
detail::TablePatternMatcher* pattern_matcher = nullptr;
|
||||
ValPtr def_val;
|
||||
detail::ExprPtr change_func;
|
||||
std::string broker_store;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue