Lines Matching refs:criterion
50 typedef ISelectionCriterionInterface Criterion;
51 typedef std::map<string, Criterion *> Criteria;
182 const PfwCriterion &criterion = criteriaArray[criterionIndex];
183 if (criterion.name == NULL) {
184 return status.failure("Criterion name is NULL");
186 if (criterion.values == NULL) {
187 return status.failure("Criterion values is NULL");
189 // Check that the criterion does not exist
190 if (criteria.find(criterion.name) != criteria.end()) {
191 return status.failure("Criterion \"" + string(criterion.name) + "\" already exist");
194 // Create criterion type
196 pfw->createSelectionCriterionType(criterion.inclusive);
198 // Add criterion values
199 for (size_t valueIndex = 0; criterion.values[valueIndex] != NULL; ++valueIndex) {
201 if (criterion.inclusive) {
204 return status.failure("Too many values for criterion " +
205 string(criterion.name));
211 const char *valueName = criterion.values[valueIndex];
215 " to criterion " + criterion.name + ": " + error);
218 // Create criterion and add it to the pfw
219 criteria[criterion.name] = pfw->createSelectionCriterion(criterion.name, type);
250 static pfw::Criterion *getCriterion(const pfw::Criteria &criteria, const string &name)
260 return status.failure("Can not set criterion \"" + string(name) +
263 pfw::Criterion *criterion = getCriterion(handle->criteria, name);
264 if (criterion == NULL) {
265 return status.failure("Can not set criterion " + string(name) + " as does not exist");
267 criterion->setCriterionState(value);
274 return status.failure("Can not get criterion \"" + string(name) +
277 pfw::Criterion *criterion = getCriterion(handle->criteria, name);
278 if (criterion == NULL) {
279 return status.failure("Can not get criterion " + string(name) + " as it does not exist");
281 *value = criterion->getCriterionState();