Evoplex
0.2.1
|
The SingleValue class. More...
#include <attributerange.h>
Public Member Functions | |
SingleValue (int id, const QString &attrName, Type type) | |
Constructor. More... | |
~SingleValue () override=default | |
Destructor. | |
Value | rand (PRG *) const override |
Gets a random value in the attribute range. More... | |
Value | next (const Value &v) const override |
Gets the value after v . More... | |
Value | prev (const Value &v) const override |
Gets the value before v . More... | |
![]() | |
~AttributeRange () override=default | |
Destructor. | |
Value | validate (const QString &valueStr) const |
Checks if the valueStr belongs to this attribute range. More... | |
bool | isValid () const |
Checks if this AttributeRange is valid. More... | |
int | id () const |
Gets the attribute id. | |
const QString & | attrName () const |
Gets the attribute name. | |
const QString & | attrRangeStr () const |
Gets the original attribute's range string. More... | |
Type | type () const |
Gets the current attribute's range type. | |
const Value & | min () const |
Gets the minimum value in the range. | |
const Value & | max () const |
Gets the maximum value in the range. | |
![]() | |
virtual | ~AttributeRangeInterface ()=default |
Destructor. | |
Additional Inherited Members | |
![]() | |
enum | Type { Invalid, Double_Range, Int_Range, Bool, Double_Set, Int_Set, String_Set, String, NonEmptyString, DirPath, FilePath } |
An enum for the attribute range types. More... | |
![]() | |
static AttributeRangePtr | parse (int attrId, const QString &attrName, const QString &attrRangeStr) |
Creates an AttributeRange object from a valid attrRangeStr string. More... | |
![]() | |
AttributeRange (int id, const QString &attrName, Type type) | |
AttributeRange constructor. More... | |
![]() | |
const int | m_id |
const QString | m_attrName |
const Type | m_type |
QString | m_attrRangeStr |
Value | m_min |
Value | m_max |
The SingleValue class.
It handles the 'attribute ranges' defined by a single value, e.g., AttributeRange::String, AttributeRange::NonEmptyString, AttributeRange::DirPath and AttributeRange::FilePath.
|
explicit |
Constructor.
id | The attribute id. |
attrName | The attribute name. |
type | The attribute type. |
Gets the value after v
.
v | A value in the attribute range. If v is the last, it returns the first value in the attrRange. if v is not in the attrRange, it returns v . |
Implements evoplex::AttributeRangeInterface.
Gets the value before v
.
v | A value in the attribute range. If v is the first, it returns the last value in the attrRange. if v is not in the attrRange, it returns v . |
Implements evoplex::AttributeRangeInterface.
Gets a random value in the attribute range.
prg | A pointer to a valid PRG. |
Implements evoplex::AttributeRangeInterface.