The RuleManager class takes care of loading and saving rules from arbitrary data sources. More...
#include <RuleManager.h>
Public Member Functions | |
RuleManager (unsigned int maxrules) | |
Creates a new RuleManager instance. More... | |
virtual | ~RuleManager () |
Destroys the RuleManager. More... | |
virtual std::vector< Rule * > | loadRules ()=0 |
Loads all existing rules from the underlying data source. More... | |
virtual std::vector< Rule * > | loadRules (unsigned int maxrules)=0 |
Loads a specific amount of rules from the underlying data source. More... | |
virtual bool | saveRules (std::vector< Rule * > rules)=0 |
Saves the passed rules to the underlying data source. More... | |
bool | saveRulesHintFile (std::string filename, LearnSystem &lsystem) const |
Saves a LearnSystem/RuleSet combination to a physical file. More... | |
unsigned int | getMaxRules () const |
Gets the maximum number of rules, an instance will deal with. More... | |
Protected Attributes | |
unsigned int | _maxrules |
The maximum amount of Rule objects the RuleManager will manage. | |
The RuleManager class takes care of loading and saving rules from arbitrary data sources.
The base is an abstract class, which's loadRules() method must be implemented according to the specific needs of the application.
Definition at line 29 of file RuleManager.h.
dynrules::RuleManager::RuleManager | ( | unsigned int | maxrules | ) |
Creates a new RuleManager instance.
maxrules | The default amount of rules to manage. |
Definition at line 14 of file RuleManager.cpp.
|
virtual |
Destroys the RuleManager.
Destroys the RuleManager and frees the memory hold by it.
Definition at line 19 of file RuleManager.cpp.
unsigned int dynrules::RuleManager::getMaxRules | ( | ) | const |
Gets the maximum number of rules, an instance will deal with.
Definition at line 23 of file RuleManager.cpp.
|
pure virtual |
Loads all existing rules from the underlying data source.
Implemented in dynrules::MMapRuleManager.
|
pure virtual |
Loads a specific amount of rules from the underlying data source.
maxrules | The amount of rules to load. |
Implemented in dynrules::MMapRuleManager.
|
pure virtual |
Saves the passed rules to the underlying data source.
rules | A std::vector containing the rules to save. |
Implemented in dynrules::MMapRuleManager.
bool dynrules::RuleManager::saveRulesHintFile | ( | std::string | filename, |
LearnSystem & | lsystem | ||
) | const |
Saves a LearnSystem/RuleSet combination to a physical file.
filename | The file name. |
lsystem | The LearnSystem to save the rules for. |
Definition at line 28 of file RuleManager.cpp.