Public Member Functions |
| Rule () |
| Creates a new Rule instance.
|
| Rule (int id) |
| Creates a new Rule instance with an unique id.
|
| Rule (int id, std::string code) |
| Creates a new Rule instance with an unique id and code.
|
| Rule (int id, double weight) |
| Creates a new Rule instance with an unique id and weight.
|
| Rule (int id, std::string code, double weight) |
| Creates a new Rule instance.
|
virtual | ~Rule () |
| Destroys the Rule.
|
double | getWeight () const |
| Gets the weight of the Rule.
|
void | setWeight (double weight) |
| Sets the weight of the Rule.
|
bool | getUsed () const |
| Gets whether the Rule was used or not.
|
void | setUsed (bool used) |
| Sets whether the Rule was used or not.
|
int | getId () const |
| Gets the (unique) id of the Rule.
|
void | setId (int id) |
| Sets the (unique) id of the Rule.
|
std::string | getCode () const |
| Gets the code hold by the Rule.
|
void | setCode (const std::string &code) |
| Sets the code to hold by the Rule.
|
bool | operator== (const Rule &rule) |
| Compares the rule with another Rule.
|
Protected Attributes |
int | _id |
| The (unique) id.
|
double | _weight |
| The current weight.
|
bool | _used |
| Usage flag indicating whether the Rule was executed.
|
std::string | _code |
| The code to execute.
|
A simple rule container.
Rule is a simple class type that carries a weight indicator and arbitrary code data for usage in the dynamic script generation process.
Definition at line 23 of file Rule.h.