mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 17:50:04 +01:00
[apps/shared/expression_model_store] Add context parameter to model testing
This commit is contained in:
committed by
LeaNumworks
parent
893131ed08
commit
56a3fcfacb
@@ -40,7 +40,7 @@ void ExpressionModelStore::tidy() {
|
||||
resetMemoizedModelsExceptRecord();
|
||||
}
|
||||
|
||||
int ExpressionModelStore::numberOfModelsSatisfyingTest(ModelTest test) const {
|
||||
int ExpressionModelStore::numberOfModelsSatisfyingTest(ModelTest test, void * context) const {
|
||||
int count = 0;
|
||||
int index = 0;
|
||||
Ion::Storage::Record record;
|
||||
@@ -49,15 +49,15 @@ int ExpressionModelStore::numberOfModelsSatisfyingTest(ModelTest test) const {
|
||||
if (record.isNull()) {
|
||||
break;
|
||||
}
|
||||
if (test(privateModelForRecord(record))) {
|
||||
if (test(privateModelForRecord(record), context)) {
|
||||
count++;
|
||||
}
|
||||
} while (true);
|
||||
return count;
|
||||
}
|
||||
|
||||
Ion::Storage::Record ExpressionModelStore::recordSatisfyingTestAtIndex(int i, ModelTest test) const {
|
||||
assert(0 <= i && i < numberOfModelsSatisfyingTest(test));
|
||||
Ion::Storage::Record ExpressionModelStore::recordSatisfyingTestAtIndex(int i, ModelTest test, void * context) const {
|
||||
assert(0 <= i && i < numberOfModelsSatisfyingTest(test, context));
|
||||
int count = 0;
|
||||
int index = 0;
|
||||
Ion::Storage::Record record;
|
||||
@@ -67,7 +67,7 @@ Ion::Storage::Record ExpressionModelStore::recordSatisfyingTestAtIndex(int i, Mo
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
if (test(privateModelForRecord(record))) {
|
||||
if (test(privateModelForRecord(record), context)) {
|
||||
if (i == count) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user