dynrules
 All Classes Functions Variables
Public Member Functions | Protected Attributes | List of all members
dynrules::RuleManager Class Referenceabstract

The RuleManager class takes care of loading and saving rules from arbitrary data sources. More...

#include <RuleManager.h>

Inheritance diagram for dynrules::RuleManager:
dynrules::MMapRuleManager

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

dynrules::RuleManager::RuleManager ( unsigned int  maxrules)

Creates a new RuleManager instance.

Parameters
maxrulesThe default amount of rules to manage.

Definition at line 14 of file RuleManager.cpp.

dynrules::RuleManager::~RuleManager ( )
virtual

Destroys the RuleManager.

Destroys the RuleManager and frees the memory hold by it.

Definition at line 19 of file RuleManager.cpp.

Member Function Documentation

unsigned int dynrules::RuleManager::getMaxRules ( ) const

Gets the maximum number of rules, an instance will deal with.

Returns
The maximum number of rules to deal with.

Definition at line 23 of file RuleManager.cpp.

virtual std::vector<Rule*> dynrules::RuleManager::loadRules ( )
pure virtual

Loads all existing rules from the underlying data source.

Returns
A std::vector containing the loaded rules.

Implemented in dynrules::MMapRuleManager.

virtual std::vector<Rule*> dynrules::RuleManager::loadRules ( unsigned int  maxrules)
pure virtual

Loads a specific amount of rules from the underlying data source.

Parameters
maxrulesThe amount of rules to load.
Returns
A std::vector containing the loaded rules.

Implemented in dynrules::MMapRuleManager.

virtual bool dynrules::RuleManager::saveRules ( std::vector< Rule * >  rules)
pure virtual

Saves the passed rules to the underlying data source.

Parameters
rulesA std::vector containing the rules to save.
Returns
true, if saving the rules was successful, false otherwise.

Implemented in dynrules::MMapRuleManager.

bool dynrules::RuleManager::saveRulesHintFile ( std::string  filename,
LearnSystem lsystem 
) const

Saves a LearnSystem/RuleSet combination to a physical file.

Parameters
filenameThe file name.
lsystemThe LearnSystem to save the rules for.
Returns
true on success, false otherwise.

Definition at line 28 of file RuleManager.cpp.


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