mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-08 01:59:33 +00:00
Add a compile_output::clone() method that can be overridden
Add a clone() method that can be overridden by subclasses. This allows copying compile state when needed in a way that preserves polymorphism. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
@@ -20,6 +20,8 @@ limitations under the License.
|
|||||||
#include "indexed_vector.h"
|
#include "indexed_vector.h"
|
||||||
#include "falco_rule.h"
|
#include "falco_rule.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace rule_loader {
|
namespace rule_loader {
|
||||||
struct compile_output {
|
struct compile_output {
|
||||||
compile_output() = default;
|
compile_output() = default;
|
||||||
@@ -29,6 +31,10 @@ struct compile_output {
|
|||||||
compile_output(const compile_output&) = default;
|
compile_output(const compile_output&) = default;
|
||||||
compile_output& operator=(const compile_output&) = default;
|
compile_output& operator=(const compile_output&) = default;
|
||||||
|
|
||||||
|
virtual std::unique_ptr<compile_output> clone() const {
|
||||||
|
return std::make_unique<compile_output>(*this);
|
||||||
|
};
|
||||||
|
|
||||||
indexed_vector<falco_list> lists;
|
indexed_vector<falco_list> lists;
|
||||||
indexed_vector<falco_macro> macros;
|
indexed_vector<falco_macro> macros;
|
||||||
indexed_vector<falco_rule> rules;
|
indexed_vector<falco_rule> rules;
|
||||||
|
Reference in New Issue
Block a user