# ace::UniRulesFilter Class Reference

Class declares interface of unirules filter. More...

`#include <filter.h>`

Inherits ace::Filter.

List of all members.

## Public Types
typedef std::vector< unirule_t > | rules_t
| The rules are stored within container.
## Public Member Functions
void | add_rule (unirule_t &rule)
| Adds given rule to filter.
const rules_t & | get_rules (void) const
bool | match (const unirule_t &value, bool include_in_stats=true)
| Essencial filter method - checks, if given value matches the filter.
virtual bool | is_on (void) const
bool | read_rules (const char *rules_filename)
| Reads rules from given file.
## Private Attributes
rules_t | _rules
| Rules container.

## Detailed Description

Class declares interface of unirules filter.

Unirule is rule with just simple (single-parted) rules.

## Member Typedef Documentation

typedef std::vector<unirule_t> ace::UniRulesFilter::rules_t

The rules are stored within container.

## Member Function Documentation

void ace::UniRulesFilter::add_rule | ( | unirule_t & | rule | ) |

Adds given rule to filter.

Parameters:

  | rule | Rule to add.

const rules_t& ace::UniRulesFilter::get_rules | ( | void |  | ) | const`[inline]`

Returns:
  Reference to const instance of rules container.

bool ace::UniRulesFilter::match | ( | const unirule_t & | value,
|  | bool | include_in_stats = `true` |
| ) |  |  |

Essencial filter method - checks, if given value matches the filter.

Parameters:

  | value | Value to check.
  | include_in_stats | Include this one in statistics?

Returns:
  True, if given value pass the filter.

virtual bool ace::UniRulesFilter::is_on | ( | void |  | ) | const`[inline, virtual]`

Returns:
  True, if there are any rules to match.

Implements ace::Filter.

bool ace::UniRulesFilter::read_rules | ( | const char * | rules_filename | ) |

Reads rules from given file.

Parameters:

  | rules_filename | Pointer to C-string with filename.

Returns:
  True, if file was processed (it doesn't mean there are any rules to check!).

## Member Data Documentation

rules_t ace::UniRulesFilter::_rules`[private]`

Rules container.

The documentation for this class was generated from the following files:

- proto/Source/filter.h
- proto/Source/filter.cpp