dynrules::RuleManagement Class Reference

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

#include <RuleManagement.h>

Inheritance diagram for dynrules::RuleManagement:
dynrules::MMapRuleManagement

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

dynrules::RuleManagement::RuleManagement ( unsigned int  maxrules  ) 

Creates a new RuleManagement instance.

Parameters:
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.


Member Function Documentation

unsigned int dynrules::RuleManagement::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 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.

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

Implemented in dynrules::MMapRuleManagement.

virtual std::vector<Rule*> dynrules::RuleManagement::loadRules (  )  [pure virtual]

Loads all existing rules from the underlying data source.

Returns:
A std::vector containing the loaded rules.

Implemented in dynrules::MMapRuleManagement.

virtual bool dynrules::RuleManagement::saveRules ( std::vector< Rule * >  rules  )  [pure virtual]

Saves the passed rules to the underlying data source.

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

Implemented in dynrules::MMapRuleManagement.

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

Saves a LearnSystem/RuleSet combination to a physical file.

Parameters:
filename The file name.
lsystem The LearnSystem to save the rules for.
Returns:
true on success, false otherwise.

Definition at line 28 of file RuleManagement.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables

Generated on Fri Dec 25 15:13:50 2009 for dynrules by  doxygen 1.6.1