MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / getRunningProcesses

Method getRunningProcesses

app/src/API/Handlers/ProcessHandler.cpp:211–228  ·  view source on GitHub ↗

* @brief Refresh and return the list of running processes. */

Source from the content-addressed store, hash-verified

209 * @brief Refresh and return the list of running processes.
210 */
211API::CommandResponse API::Handlers::ProcessHandler::getRunningProcesses(const QString& id,
212 const QJsonObject& params)
213{
214 Q_UNUSED(params)
215
216 IO::ConnectionManager::instance().process()->refreshProcessList();
217
218 const auto& processes = IO::ConnectionManager::instance().process()->runningProcesses();
219
220 QJsonArray processes_array;
221 for (const auto& proc : processes)
222 processes_array.append(proc);
223
224 QJsonObject result;
225 result[QStringLiteral("processes")] = processes_array;
226 result[QStringLiteral("count")] = processes_array.count();
227 return CommandResponse::makeSuccess(id, result);
228}
229
230/**
231 * @brief Get the complete Process driver configuration.

Callers

nothing calls this directly

Calls 5

refreshProcessListMethod · 0.80
processMethod · 0.45
runningProcessesMethod · 0.45
appendMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected