mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-30 11:44:28 +03:00
expressions: add much faster limitToSignatures()
This commit is contained in:
committed by
Matthew Barr
parent
0b8f25a036
commit
083d84cfd6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Intel Corporation
|
||||
* Copyright (c) 2015-2017, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -31,10 +31,10 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
typedef std::map<unsigned, std::string> ExpressionMap;
|
||||
typedef std::list<unsigned> SignatureSet;
|
||||
using ExpressionMap = std::map<unsigned, std::string>;
|
||||
using SignatureSet = std::vector<unsigned>;
|
||||
|
||||
// load all of the expressions from the given directory into the given
|
||||
// expression map. Exits on failure.
|
||||
@@ -45,11 +45,8 @@ void loadExpressionsFromFile(const std::string &fname, ExpressionMap &exprMap);
|
||||
// load a list of signature IDs
|
||||
void loadSignatureList(const std::string &inFile, SignatureSet &signatures);
|
||||
|
||||
// produce a new expression map only containing those signatures in the
|
||||
// expression list
|
||||
void generateExprMap(const SignatureSet &signatures,
|
||||
const ExpressionMap &allExprs, ExpressionMap &out);
|
||||
// trim expression map to only the given signatures, returning result
|
||||
ExpressionMap limitToSignatures(const ExpressionMap &exprMap,
|
||||
const SignatureSet &signatures);
|
||||
|
||||
// trim expression map to only the given signatures (in-place)
|
||||
void limitBySignature(ExpressionMap &exprMap, const SignatureSet &signatures);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user