Generates a set of Attributes.
More...
#include <attrsgenerator.h>
|
virtual | ~AttrsGenerator ()=default |
| Destructor.
|
|
AttributesScope | attrsScope () const |
| Gets the attribute's scope.
|
|
const QString & | command () |
| Gets the source command for the AttrsGenerator object.
|
|
int | size () const |
| Gets the size of the set of attributes.
|
|
virtual | ~AttrsGeneratorInterface ()=default |
| Destructor.
|
|
virtual SetOfAttributes | create (int size=-1, std::function< void(int)> progress=[](int){})=0 |
| Creates a set of attributes. More...
|
|
|
const AttributesScope | m_attrsScope |
|
const int | m_size |
|
QString | m_command |
|
◆ AttrsGenerator()
evoplex::AttrsGenerator::AttrsGenerator |
( |
const AttributesScope & |
attrsScope, |
|
|
const int |
size |
|
) |
| |
|
explicitprotected |
Constructor.
- Parameters
-
attrsScope | The attribute's scope. |
size | The size of the generated set of attributes. |
◆ parse()
static AttrsGeneratorPtr evoplex::AttrsGenerator::parse |
( |
const AttributesScope & |
attrsScope, |
|
|
const QString & |
cmd, |
|
|
QString & |
error |
|
) |
| |
|
static |
Creates a AttrsGenerator object from a command.
- Parameters
-
[in] | attrsScope | The attribute's scope. |
[in] | cmd | The command. |
[out] | error | The error message. |
The valid commands (cmd
) are described below. In those commands, the 'integer' corresponds to the size
of the set of attributes to be returned.
- integer
- same function for all attributes:
- "*integer;min"
- "*integer;max"
- "*integer;rand_seed" - seed is an integer
- "*min" - alias for "*1;min"
- "*max" - alias for "*1;max"
- "*rand_seed" - alias for "*1;rand_seed", where seed is an integer
- specific function for each attribute:
- "#integer;attrName1_func;...;attrNameN_func"
- attrName: The attribute name.
- func: min, max, rand_seed or value_val (val is the input).
- "#attrName_func;..." - alias for "#1;attrName_func;..."
- func: min, max, rand_seed or value_val (val is the input).
◆ parseRandSeed()
static Value evoplex::AttrsGenerator::parseRandSeed |
( |
QString |
seedStr | ) |
|
|
static |
Parse a 'rand_seed' command.
- Parameters
-
seedStr | A 'rand_seed' command, where seed is a positive integer. If seed is a positive int, it returns this number as a Value object. Else, it returns an invalid Value. |
The documentation for this class was generated from the following file: