#include <constraintgroup.h>
Public Member Functions | |
| Constraint * | value (QString key) const |
| ConstraintGroup () | |
| bool | hasConstraint (QString className, QString propertyName) |
| |
| virtual QString | toString () const |
| |
| bool | filter (const ConstrainedDataObject *theObject, QString classname=QString()) |
| Filter method. | |
| void | addTypeConstraints (const QObject &prototype) |
| Intraspects the properties of the prototype and inserts type-based constraints into the constraint map for the prototype's class. | |
| Constraint * | getConstraint (QString className, QString propertyName) |
| Return pointer to constraint for a particular className::propertyName. | |
| void | setRegexConstraint (QString className, QString propertyName, QString regularExpression) |
| Convenience method which creates/sets a RegexConstraint. | |
| void | setDoubleRangeConstraint (QString className, QString propertyName, double lowval, double highval) |
| Convenience method which creates/sets a DoubleRangeConstraint. | |
| void | setConstraint (QString className, QString propertyName, Constraint *constraint) |
| Sets a constraint on a particular className::propertyName. | |
| virtual | ~ConstraintGroup () |
| Deletes the constraint objects that were added to this structure as well. | |
Used to describe multidimensional constraints. First, it is a singleton used by ConstrainedDataObject to impose setProperty() constraints. Second, it is used to describe multidimensional queries.
Definition at line 24 of file constraintgroup.h.
| bool ConstraintGroup::filter | ( | const ConstrainedDataObject * | theObject, | |
| QString | classname = QString() | |||
| ) |
Filter method.
| theObject | - the object with values to check against constraints | |
| classname | - the name of the class which we wish to constrain the dataobject. If null, then defaults to whatever theObject.objectype() returns. |
Definition at line 41 of file constraintgroup.cpp.
References Constraint::accepts(), DataObject::className(), hasConstraint(), DataObject::property(), DataObject::propertyNames(), and value().
Here is the call graph for this function:

| void ConstraintGroup::addTypeConstraints | ( | const QObject & | prototype | ) |
Intraspects the properties of the prototype and inserts type-based constraints into the constraint map for the prototype's class.
Currently only looks at enum and QDate properties.
| prototype | the object to intraspect |
Definition at line 84 of file constraintgroup.cpp.
References setConstraint().
Here is the call graph for this function:

| Constraint * ConstraintGroup::getConstraint | ( | QString | className, | |
| QString | propertyName | |||
| ) |
Return pointer to constraint for a particular className::propertyName.
Definition at line 65 of file constraintgroup.cpp.
References value().
Referenced by ConstrainedDataObject::setProperty(), and ConstrainedDataObject::validInputs().
Here is the call graph for this function:

| void ConstraintGroup::setRegexConstraint | ( | QString | className, | |
| QString | propertyName, | |||
| QString | regularExpression | |||
| ) |
Convenience method which creates/sets a RegexConstraint.
| regularExpression | the expression to create a QRegExp from |
Definition at line 72 of file constraintgroup.cpp.
References setConstraint().
Here is the call graph for this function:

| void ConstraintGroup::setDoubleRangeConstraint | ( | QString | className, | |
| QString | propertyName, | |||
| double | lowval, | |||
| double | highval | |||
| ) |
Convenience method which creates/sets a DoubleRangeConstraint.
Assumes the property is a double type.
Definition at line 129 of file constraintgroup.cpp.
References setConstraint().
Here is the call graph for this function:

1.5.1