dynrules
|
The RuleManagement class takes care of loading and saving rules from arbitrary data sources. More...
#include <RuleManagement.h>
Public Member Functions | |
RuleManagement (unsigned int maxrules) | |
Creates a new RuleManagement instance. | |
virtual | ~RuleManagement () |
Destroys the RuleManagement. | |
virtual std::vector< Rule * > | loadRules ()=0 |
Loads all existing rules from the underlying data source. | |
virtual std::vector< Rule * > | loadRules (unsigned int maxrules)=0 |
Loads a specific amount of rules from the underlying data source. | |
virtual bool | saveRules (std::vector< Rule * > rules)=0 |
Saves the passed rules to the underlying data source. | |
bool | saveRulesHintFile (std::string filename, LearnSystem &lsystem) const |
Saves a LearnSystem/RuleSet combination to a physical file. | |
unsigned int | getMaxRules () const |
Gets the maximum number of rules, an instance will deal with. | |
Protected Attributes | |
unsigned int | _maxrules |
The maximum amount of Rule objects the RuleManagement will manage. |
The RuleManagement 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 RuleManagement.h.
dynrules::RuleManagement::RuleManagement | ( | unsigned int | maxrules | ) |
Creates a new RuleManagement instance.
maxrules | The default amount of rules to manage. |
Definition at line 14 of file RuleManagement.cpp.
dynrules::RuleManagement::~RuleManagement | ( | ) | [virtual] |
Destroys the RuleManagement.
Destroys the RuleManagement and frees the memory hold by it.
Definition at line 19 of file RuleManagement.cpp.
unsigned int dynrules::RuleManagement::getMaxRules | ( | ) | const |
Gets the maximum number of rules, an instance will deal with.
Definition at line 23 of file RuleManagement.cpp.
virtual std::vector<Rule*> dynrules::RuleManagement::loadRules | ( | unsigned int | maxrules | ) | [pure virtual] |
Loads a specific amount of rules from the underlying data source.
maxrules | The amount of rules to load. |
Implemented in dynrules::MMapRuleManagement.
virtual std::vector<Rule*> dynrules::RuleManagement::loadRules | ( | ) | [pure virtual] |
Loads all existing rules from the underlying data source.
Implemented in dynrules::MMapRuleManagement.
virtual bool dynrules::RuleManagement::saveRules | ( | std::vector< Rule * > | rules | ) | [pure virtual] |
Saves the passed rules to the underlying data source.
rules | A std::vector containing the rules to save. |
Implemented in dynrules::MMapRuleManagement.
bool dynrules::RuleManagement::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 RuleManagement.cpp.