| 232 | } |
| 233 | |
| 234 | ParametricTable<int, Json> FunctionDatabase::parametricTableFromConfig(Json descriptor) { |
| 235 | try { |
| 236 | List<pair<int, Json>> points; |
| 237 | for (size_t i = 0; i < descriptor.size(); ++i) { |
| 238 | auto pointPair = descriptor.get(i); |
| 239 | if (pointPair.size() != 2) |
| 240 | throw StoredFunctionException("Each point must be a list of size 2"); |
| 241 | points.append({pointPair.getInt(0), pointPair.get(1)}); |
| 242 | } |
| 243 | |
| 244 | return ParametricTable<int, Json>(points); |
| 245 | } catch (StarException const& e) { |
| 246 | throw StoredFunctionException("Error parsing StoredConfigFunction descriptor", e); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | MultiTable2D FunctionDatabase::multiTable2DFromConfig(Json descriptor) { |
| 251 | try { |