fix(userspace): add explicit constructors and initializations

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce
2022-10-03 09:17:17 +00:00
committed by poiana
parent 545b58ee14
commit 5781c53ddc
18 changed files with 192 additions and 12 deletions

View File

@@ -26,6 +26,23 @@ limitations under the License.
*/
struct falco_source
{
falco_source() = default;
falco_source(falco_source&&) = default;
falco_source& operator = (falco_source&&) = default;
falco_source(const falco_source& s):
name(s.name),
ruleset_factory(s.ruleset_factory),
filter_factory(s.filter_factory),
formatter_factory(s.formatter_factory) { };
falco_source& operator = (const falco_source& s)
{
name = s.name;
ruleset_factory = s.ruleset_factory;
filter_factory = s.filter_factory;
formatter_factory = s.formatter_factory;
return *this;
};
std::string name;
std::shared_ptr<filter_ruleset> ruleset;
std::shared_ptr<filter_ruleset_factory> ruleset_factory;
@@ -36,7 +53,7 @@ struct falco_source
// matches an event.
mutable falco_rule m_rule;
inline bool is_field_defined(std::string field) const
inline bool is_field_defined(const std::string& field) const
{
auto *chk = filter_factory->new_filtercheck(field.c_str());
if (chk)