| 273 | } |
| 274 | |
| 275 | nlohmann::json toJSON() const override { |
| 276 | auto j = nlohmann::json{}; |
| 277 | |
| 278 | j = nlohmann::json::object(); |
| 279 | j["code"] = mCCode; |
| 280 | j["function"] = mFunctionName; |
| 281 | |
| 282 | auto& jsonExtraFlags = j["extraflags"]; |
| 283 | jsonExtraFlags = nlohmann::json::array(); |
| 284 | for (const auto& flag : mExtraArguments) { jsonExtraFlags.push_back(flag); } |
| 285 | |
| 286 | auto& jsonInputs = j["inputs"]; |
| 287 | jsonInputs = nlohmann::json::array(); |
| 288 | for (const auto& in : mInputs) { |
| 289 | jsonInputs.push_back({{in.name, in.type.qualifiedName()}}); |
| 290 | } |
| 291 | |
| 292 | if (mOutput.valid()) { |
| 293 | j["output"] = mOutput.qualifiedName(); |
| 294 | } else { |
| 295 | j["output"] = nlohmann::json(); |
| 296 | } |
| 297 | |
| 298 | return j; |
| 299 | } |
| 300 | |
| 301 | std::unique_ptr<NodeType> clone() const override { |
| 302 | Result res; |
no test coverage detected