C++: Use model interfaces in SafeExternalAPIFunction and make the three previosuly-used implementation models private.

This commit is contained in:
Mathias Vorreiter Pedersen
2020-11-25 18:20:55 +01:00
parent 65dbb6e45f
commit 7730f5dfcf
3 changed files with 9 additions and 11 deletions

View File

@@ -13,9 +13,7 @@ abstract class SafeExternalAPIFunction extends Function { }
/** The default set of "safe" external APIs. */
private class DefaultSafeExternalAPIFunction extends SafeExternalAPIFunction {
DefaultSafeExternalAPIFunction() {
// implementation note: this should be based on the properties of public interfaces, rather than accessing implementation classes directly. When we've done that, the three classes referenced here should be made fully private.
this instanceof PureStrFunction or
this instanceof StrLenFunction or
this instanceof PureMemFunction
this instanceof ArrayFunction and
not this.(ArrayFunction).hasArrayOutput(_)
}
}

View File

@@ -13,9 +13,7 @@ abstract class SafeExternalAPIFunction extends Function { }
/** The default set of "safe" external APIs. */
private class DefaultSafeExternalAPIFunction extends SafeExternalAPIFunction {
DefaultSafeExternalAPIFunction() {
// implementation note: this should be based on the properties of public interfaces, rather than accessing implementation classes directly. When we've done that, the three classes referenced here should be made fully private.
this instanceof PureStrFunction or
this instanceof StrLenFunction or
this instanceof PureMemFunction
this instanceof ArrayFunction and
not this.(ArrayFunction).hasArrayOutput(_)
}
}