Read metadata (NOT create) from the class table on top of `L` into a FilterClass. Leaves the stack as found. Returns an error string.
| 364 | // Read metadata (NOT create) from the class table on top of `L` into a |
| 365 | // FilterClass. Leaves the stack as found. Returns an error string. |
| 366 | std::string readClassMetadata(lua_State* L, FilterClass& fc) { |
| 367 | const int idx = lua_gettop(L); |
| 368 | fc.id = stringField(L, idx, "id"); |
| 369 | fc.name = stringField(L, idx, "name", fc.id); |
| 370 | if (fc.id.empty()) { |
| 371 | return "filter class is missing its `id`"; |
| 372 | } |
| 373 | fc.description = stringField(L, idx, "description"); |
| 374 | fc.version = stringField(L, idx, "version"); |
| 375 | fc.output_kind = stringField(L, idx, "output", "double"); |
| 376 | return readParameters(L, idx, fc.parameters); |
| 377 | } |
| 378 | |
| 379 | // Bind an instance method (`calculate`/`reset`) by name WITHOUT triggering any |
| 380 | // metamethod: first a raw field on the instance, else a raw lookup through a |
no test coverage detected