2014-06-13 13:17:38 -04:00
|
|
|
#ifndef RULESETS_FILTER_H_
|
|
|
|
|
#define RULESETS_FILTER_H_
|
|
|
|
|
|
|
|
|
|
#include "ParserDefinitions.h"
|
|
|
|
|
|
|
|
|
|
///\brief This class is used to search entities in NPC's memory
|
|
|
|
|
///using a query as a filter
|
|
|
|
|
namespace EntityFilter
|
|
|
|
|
{
|
|
|
|
|
///Main Filtering class
|
|
|
|
|
class Filter {
|
|
|
|
|
public:
|
|
|
|
|
///\brief Initialize a filter with a given query
|
|
|
|
|
///@param what query to be used for filtering
|
2014-08-15 13:53:17 -04:00
|
|
|
///@param factory a pointer to a factory to handle segments
|
|
|
|
|
Filter(const std::string &what, ProviderFactory* factory);
|
2014-07-30 16:42:51 -04:00
|
|
|
~Filter();
|
2014-06-13 13:17:38 -04:00
|
|
|
|
2014-06-27 15:27:01 -04:00
|
|
|
///\brief test given entity for a match
|
|
|
|
|
///@param entity - entity to be tested
|
|
|
|
|
bool match(LocatedEntity& entity);
|
2014-07-30 16:42:51 -04:00
|
|
|
///\brief test given QueryContext for a match
|
2014-08-13 13:07:46 -04:00
|
|
|
bool match(const QueryContext& context);
|
2014-06-13 13:17:38 -04:00
|
|
|
private:
|
2014-07-30 16:42:51 -04:00
|
|
|
//The top predicate node used for testing
|
|
|
|
|
Predicate* m_predicate;
|
2014-06-13 13:17:38 -04:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
#endif
|