diff --git a/tools/projmgr/.gitignore b/tools/projmgr/.gitignore new file mode 100644 index 000000000..b0fb5b5c9 --- /dev/null +++ b/tools/projmgr/.gitignore @@ -0,0 +1 @@ +templates/debug-adapters.yml diff --git a/tools/projmgr/CMakeLists.txt b/tools/projmgr/CMakeLists.txt index bad6f8fda..34c8d38d8 100644 --- a/tools/projmgr/CMakeLists.txt +++ b/tools/projmgr/CMakeLists.txt @@ -12,6 +12,15 @@ file(DOWNLOAD ${CMAKE_CURRENT_SOURCE_DIR}/templates/debug-adapters.yml ) +# rpc interface +include(FetchContent) +FetchContent_Declare( + rpc-interface + URL https://github.com/Open-CMSIS-Pack/csolution-rpc/releases/download/v0.0.1/csolution-rpc.zip + URL_HASH SHA256=e5e6528ace7cf9b31a24ef268f9d86a9810d3a84c0e4e166dfe2c745e734524a +) +FetchContent_MakeAvailable(rpc-interface) + set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT projmgr) # projmgr library @@ -30,13 +39,16 @@ SET(PROJMGR_HEADER_FILES ProjMgr.h ProjMgrKernel.h ProjMgrCallback.h ProjMgrYamlEmitter.h ProjMgrUtils.h ProjMgrExtGenerator.h ProjMgrCbuildBase.h ProjMgrRunDebug.h ProjMgrRpcServer.h ProjMgrRpcServerData.h - RpcInterface.h ) list(TRANSFORM PROJMGR_SOURCE_FILES PREPEND src/) list(TRANSFORM PROJMGR_HEADER_FILES PREPEND include/) -add_library(projmgrlib OBJECT ${PROJMGR_SOURCE_FILES} ${PROJMGR_HEADER_FILES}) +add_library(projmgrlib OBJECT + ${PROJMGR_SOURCE_FILES} + ${PROJMGR_HEADER_FILES} + ${rpc-interface_SOURCE_DIR}/RpcInterface.h +) target_link_libraries(projmgrlib PUBLIC CrossPlatform RteFsUtils RteUtils XmlTree XmlTreeSlim XmlReader @@ -45,6 +57,7 @@ target_link_libraries(projmgrlib target_include_directories(projmgrlib PUBLIC include ${PROJECT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/external/json ${CMAKE_SOURCE_DIR}/external/json-rpc-cxx/include + ${rpc-interface_SOURCE_DIR} ) if(SWIG_LIBS) diff --git a/tools/projmgr/include/ProjMgrRpcServerData.h b/tools/projmgr/include/ProjMgrRpcServerData.h index 3f1075201..7f76ee3f3 100644 --- a/tools/projmgr/include/ProjMgrRpcServerData.h +++ b/tools/projmgr/include/ProjMgrRpcServerData.h @@ -6,7 +6,7 @@ #ifndef PROJMGRRPCSERVERDATA_H #define PROJMGRRPCSERVERDATA_H -#include +#include "RpcInterface.h" using namespace std; @@ -23,19 +23,19 @@ class RpcDataCollector { RteTarget* GetTarget() const { return m_target; } - void CollectCtClasses(Args::CtRoot& ctRoot) const; - void CollectUsedItems(Args::UsedItems& usedItems) const; + void CollectCtClasses(RpcArgs::CtRoot& ctRoot) const; + void CollectUsedItems(RpcArgs::UsedItems& usedItems) const; - Args::Component FromRteComponent(const RteComponent* rteComponent) const; - Args::ComponentInstance FromComponentInstance(const RteComponentInstance* rteCi) const; + RpcArgs::Component FromRteComponent(const RteComponent* rteComponent) const; + RpcArgs::ComponentInstance FromComponentInstance(const RteComponentInstance* rteCi) const; RteItem* GetTaxonomyItem(const RteComponentGroup* rteGroup) const; protected: - void CollectCtBundles(Args::CtClass& ctClass, RteComponentGroup* rteClass) const; - void CollectCtChildren(Args::CtTreeItem& parent, RteComponentGroup* rteGroup, const string& bundleName) const; - void CollectCtAggregates(Args::CtTreeItem& parent, RteComponentGroup* rteGroup, const string& bundleName) const; - void CollectCtVariants(Args::CtAggregate& ctAggregate, RteComponentAggregate* rteAggregate) const; + void CollectCtBundles(RpcArgs::CtClass& ctClass, RteComponentGroup* rteClass) const; + void CollectCtChildren(RpcArgs::CtTreeItem& parent, RteComponentGroup* rteGroup, const string& bundleName) const; + void CollectCtAggregates(RpcArgs::CtTreeItem& parent, RteComponentGroup* rteGroup, const string& bundleName) const; + void CollectCtVariants(RpcArgs::CtAggregate& ctAggregate, RteComponentAggregate* rteAggregate) const; private: RteTarget* m_target; diff --git a/tools/projmgr/include/RpcInterface.h b/tools/projmgr/include/RpcInterface.h deleted file mode 100644 index 62f2c3cfd..000000000 --- a/tools/projmgr/include/RpcInterface.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2025 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef RPCINTERFACE_H -#define RPCINTERFACE_H - -#include -#include -#include -#include - -using namespace std; -using namespace jsonrpccxx; - -namespace Args { - - struct PackElement { - string id; - optional description; - optional doc; - }; - - // GetPacksInfo - struct Pack : public PackElement { - optional overview; - optional used; - optional> references; - }; - struct PacksInfo { - vector packs; - }; - - // GetCoponentTree - struct Component : public PackElement { - string fromPack; - optional implements; - optional maxInstances; - }; - - using Api = PackElement; - using Taxonomy = PackElement; - using Bundle = PackElement; - - // component Tree - struct CtItem { - string name; - }; - - struct ComponentInstance { - string id; - int selectedCount; // number of selected instances - optional resolvedComponent; - optional layer; - }; - - struct CtVariant : public CtItem { - vector components; // version-sorted components - }; - - struct CtAggregate : public CtItem { - string id; - optional activeVariant; - optional activeVersion; - optional selectedCount; // selection flag, represents selected number of instances - vector variants; - optional layer; - }; - - struct CtGroup; - struct CtAggregate; - struct CtTreeItem : public CtItem { - optional> groups; - optional> aggregates; - }; - - struct CtGroup : public CtTreeItem { - optional api; - optional taxonomy; - }; - - struct CtBundle : public CtTreeItem { - optional bundle; - }; - - struct CtClass : public CtItem{ - optional taxonomy; - optional activeBundle; - vector bundles; - }; - - struct CtRoot { - vector classes; - }; - - // ValidateComponents - struct Condition { - string expression; - optional> aggregates; - }; - struct Result { - string result; - string id; - optional> aggregates; - optional> conditions; - }; - struct Results { - optional> validation; - }; - - struct UsedItems { - vector components; - vector packs; - }; - - // GetLogMessages - struct LogMessages { - optional> info; - optional> errors; - optional> warnings; - }; - - // to_json converters - template void to_json(nlohmann::json& j, const string& key, const T& value) { - j[key] = value; - } - template void to_json(nlohmann::json& j, const string& key, const optional& opt) { - if (opt.has_value()) { - j[key] = opt.value(); - } - } - inline void to_json(nlohmann::json& j, const Pack& p) { - to_json(j, "id", p.id); - to_json(j, "description", p.description); - to_json(j, "overview", p.overview); - to_json(j, "used", p.used); - to_json(j, "references", p.references); - } - inline void to_json(nlohmann::json& j, const PacksInfo& info) { - to_json(j, "packs", info.packs); - } - - inline void to_json(nlohmann::json& j, const Component& c) { - to_json(j, "id", c.id); - to_json(j, "description", c.description); - to_json(j, "doc", c.doc); - to_json(j, "from-pack", c.fromPack); - to_json(j, "implements", c.implements); - to_json(j, "maxInstances", c.maxInstances); - } - inline void to_json(nlohmann::json& j, const PackElement& e) { - to_json(j, "id", e.id); - to_json(j, "description", e.description); - to_json(j, "doc", e.doc); - } - - inline void to_json(nlohmann::json& j, const ComponentInstance& ci) { - to_json(j, "id", ci.id); - to_json(j, "selectedCount", ci.selectedCount); - to_json(j, "layer", ci.layer); - to_json(j, "resolvedComponent", ci.resolvedComponent); - } - - inline void to_json(nlohmann::json& j, const Condition& c) { - to_json(j, "expression", c.expression); - to_json(j, "aggregates", c.aggregates); - } - inline void to_json(nlohmann::json& j, const Result& r) { - to_json(j, "result", r.result); - to_json(j, "id", r.id); - to_json(j, "aggregates", r.aggregates); - to_json(j, "conditions", r.conditions); - } - inline void to_json(nlohmann::json& j, const Results& r) { - to_json(j, "validation", r.validation); - } - - inline void to_json(nlohmann::json& j, const LogMessages& m) { - to_json(j, "info", m.info); - to_json(j, "errors", m.errors); - to_json(j, "warnings", m.warnings); - } - - inline void to_json(nlohmann::json& j, const CtVariant& v) { - to_json(j, "name", v.name); - to_json(j, "components", v.components); - } - - inline void to_json(nlohmann::json& j, const CtAggregate& a) { - to_json(j, "name", a.name); - to_json(j, "id", a.id); - to_json(j, "selectedCount", a.selectedCount); - to_json(j, "activeVariant", a.activeVariant); - to_json(j, "activeVersion", a.activeVersion); - to_json(j, "layer", a.layer); - to_json(j, "variants", a.variants); - } - - inline void to_json(nlohmann::json& j, const CtGroup& g) { - to_json(j, "name", g.name); - to_json(j, "api", g.api); - to_json(j, "taxonomy", g.taxonomy); - to_json(j, "groups", g.groups); - to_json(j, "aggregates", g.aggregates); - } - - inline void to_json(nlohmann::json& j, const CtBundle& b) { - to_json(j, "name", b.name); - to_json(j, "bundle", b.bundle); - to_json(j, "groups", b.groups); - to_json(j, "aggregates", b.aggregates); - } - - inline void to_json(nlohmann::json& j, const CtClass& c) { - to_json(j, "name", c.name); - to_json(j, "activeBundle", c.activeBundle); - to_json(j, "bundles", c.bundles); - to_json(j, "taxonomy", c.taxonomy); - } - - inline void to_json(nlohmann::json& j, const UsedItems& u) { - to_json(j, "components", u.components); - to_json(j, "packs", u.packs); - } - - inline void to_json(nlohmann::json& j, const CtRoot& r) { - to_json(j, "classes", r.classes); - } -} - -class RpcMethods { -public: - RpcMethods(JsonRpc2Server& jsonServer) { - jsonServer.Add("GetVersion", GetHandle(&RpcMethods::GetVersion, *this)); - jsonServer.Add("Shutdown", GetHandle(&RpcMethods::Shutdown, *this)); - jsonServer.Add("Apply", GetHandle(&RpcMethods::Apply, *this), { "context" }); - jsonServer.Add("LoadPacks", GetHandle(&RpcMethods::LoadPacks, *this)); - jsonServer.Add("LoadSolution", GetHandle(&RpcMethods::LoadSolution, *this), { "solution" }); - jsonServer.Add("GetPacksInfo", GetHandle(&RpcMethods::GetPacksInfo, *this), { "context" }); - jsonServer.Add("GetUsedItems", GetHandle(&RpcMethods::GetUsedItems, *this), { "context" }); - jsonServer.Add("GetComponentsTree", GetHandle(&RpcMethods::GetComponentsTree, *this), { "context", "all" }); - jsonServer.Add("SelectComponent", GetHandle(&RpcMethods::SelectComponent, *this), { "context", "id", "count" }); - jsonServer.Add("SelectVariant", GetHandle(&RpcMethods::SelectVariant, *this), { "context", "id", "variant" }); - jsonServer.Add("SelectVersion", GetHandle(&RpcMethods::SelectVersion, *this), { "context", "id", "version" }); - jsonServer.Add("SelectBundle", GetHandle(&RpcMethods::SelectBundle, *this), { "context", "class", "bundle" }); - jsonServer.Add("ValidateComponents", GetHandle(&RpcMethods::ValidateComponents, *this), { "context" }); - jsonServer.Add("GetLogMessages", GetHandle(&RpcMethods::GetLogMessages, *this)); - } - virtual const string GetVersion(void) { return string(); } - virtual const bool Shutdown(void) { return bool(); } - virtual const bool Apply(const string& context) { return bool(); } - virtual const bool LoadPacks(void) { return bool(); } - virtual const bool LoadSolution(const string& solution) { return bool(); } - virtual const Args::UsedItems GetUsedItems(const string& context) { return Args::UsedItems(); } - virtual const Args::PacksInfo GetPacksInfo(const string& context) { return Args::PacksInfo(); } - virtual const Args::CtRoot GetComponentsTree(const string& context, bool all) { return Args::CtRoot(); } - virtual const bool SelectComponent(const string& context, const string& aggregateId, int count) { return bool(); } - virtual const bool SelectVariant(const string& context, const string& aggregateId, const string& variantName) { return bool(); } - virtual const bool SelectVersion(const string& context, const string& aggregateId, const string& version) { return bool(); } - virtual const bool SelectBundle(const string& context, const string& className, const string& bundleName) { return bool(); } - virtual const Args::Results ValidateComponents(const string& context) { return Args::Results(); } - virtual const Args::LogMessages GetLogMessages(void) { return Args::LogMessages(); } -}; - -#endif // RPCINTERFACE_H diff --git a/tools/projmgr/src/ProjMgrRpcServer.cpp b/tools/projmgr/src/ProjMgrRpcServer.cpp index 2016196a1..a55b64025 100644 --- a/tools/projmgr/src/ProjMgrRpcServer.cpp +++ b/tools/projmgr/src/ProjMgrRpcServer.cpp @@ -16,7 +16,6 @@ #include using namespace std; -using namespace jsonrpccxx; static constexpr const char* CONTENT_LENGTH_HEADER = "Content-Length:"; @@ -72,20 +71,20 @@ class RpcHandler : public RpcMethods { m_manager(server.GetManager()), m_worker(server.GetManager().GetWorker()) {} - const string GetVersion(void); - const bool Shutdown(void); - const bool Apply(const string& context); - const bool LoadPacks(void); - const bool LoadSolution(const string& solution); - const Args::UsedItems GetUsedItems(const string& context); - const Args::PacksInfo GetPacksInfo(const string& context); - const Args::CtRoot GetComponentsTree(const string& context, bool all); - const bool SelectComponent(const string& context, const string& aggregateId, int count); - const bool SelectVariant(const string& context, const string& aggregateId, const string& variantName); - const bool SelectVersion(const string& context, const string& aggregateId, const string& version); - const bool SelectBundle(const string& context, const string& className, const string& bundleName); - const Args::Results ValidateComponents(const string& context); - const Args::LogMessages GetLogMessages(void); + string GetVersion(void); + bool Shutdown(void); + bool Apply(const string& context); + bool LoadPacks(void); + bool LoadSolution(const string& solution); + RpcArgs::UsedItems GetUsedItems(const string& context); + RpcArgs::PacksInfo GetPacksInfo(const string& context); + RpcArgs::CtRoot GetComponentsTree(const string& context, const bool& all); + bool SelectComponent(const string& context, const string& aggregateId, int count); + bool SelectVariant(const string& context, const string& aggregateId, const string& variantName); + bool SelectVersion(const string& context, const string& aggregateId, const string& version); + bool SelectBundle(const string& context, const string& className, const string& bundleName); + RpcArgs::Results ValidateComponents(const string& context); + RpcArgs::LogMessages GetLogMessages(void); protected: enum Exception @@ -111,7 +110,7 @@ class RpcHandler : public RpcMethods { const ContextItem& GetContext(const string& context) const; RteTarget* GetActiveTarget(const string& context) const; RteComponentAggregate* GetComponentAggregate(const string& context, const string& id) const; - const bool SelectVariantOrVersion(const string& context, const string& id, const string& value, bool bVariant); + bool SelectVariantOrVersion(const string& context, const string& id, const string& value, bool bVariant); }; bool ProjMgrRpcServer::Run(void) { @@ -182,16 +181,16 @@ RteComponentAggregate* RpcHandler::GetComponentAggregate(const string& context, return rteAggregate; } -const string RpcHandler::GetVersion(void) { +string RpcHandler::GetVersion(void) { return VERSION_STRING; } -const bool RpcHandler::Shutdown(void) { +bool RpcHandler::Shutdown(void) { m_server.SetShutdown(true); return true; } -const bool RpcHandler::Apply(const string& context) { +bool RpcHandler::Apply(const string& context) { auto rteProject = GetActiveTarget(context)->GetProject(); if(rteProject) { @@ -200,15 +199,15 @@ const bool RpcHandler::Apply(const string& context) { return false; } -const Args::UsedItems RpcHandler::GetUsedItems(const string& context) { +RpcArgs::UsedItems RpcHandler::GetUsedItems(const string& context) { - Args::UsedItems usedItems; + RpcArgs::UsedItems usedItems; RpcDataCollector dc(GetActiveTarget(context)); dc.CollectUsedItems(usedItems); return usedItems; } -const bool RpcHandler::LoadPacks(void) { +bool RpcHandler::LoadPacks(void) { m_packsLoaded = m_worker.LoadPacks(m_globalContext); if (!m_packsLoaded) { throw JsonRpcException(PACKS_LOADING_FAIL, "packs failed to load"); @@ -216,7 +215,7 @@ const bool RpcHandler::LoadPacks(void) { return true; } -const bool RpcHandler::LoadSolution(const string& solution) { +bool RpcHandler::LoadSolution(const string& solution) { if (!m_packsLoaded) { throw JsonRpcException(PACKS_NOT_LOADED, "packs must be loaded before proceeding"); } @@ -231,7 +230,7 @@ const bool RpcHandler::LoadSolution(const string& solution) { return true; } -const Args::PacksInfo RpcHandler::GetPacksInfo(const string& context) { +RpcArgs::PacksInfo RpcHandler::GetPacksInfo(const string& context) { const auto contextItem = GetContext(context); map> packRefs; @@ -242,9 +241,9 @@ const Args::PacksInfo RpcHandler::GetPacksInfo(const string& context) { } } - Args::PacksInfo packsInfo; + RpcArgs::PacksInfo packsInfo; for (auto& [pack, packItem] : m_globalContext.rteActiveTarget->GetFilteredModel()->GetPackages()) { - Args::Pack p; + RpcArgs::Pack p; p.id = packItem->GetPackageID(true); const auto& description = packItem->GetDescription(); if (!description.empty()) { @@ -267,8 +266,8 @@ const Args::PacksInfo RpcHandler::GetPacksInfo(const string& context) { return packsInfo; } -const Args::CtRoot RpcHandler::GetComponentsTree(const string& context, bool all) { - Args::CtRoot ctRoot; +RpcArgs::CtRoot RpcHandler::GetComponentsTree(const string& context, const bool& all) { + RpcArgs::CtRoot ctRoot; RteTarget* rteTarget = GetActiveTarget(context); // store selected components, not aggregates: they will be destroyed map selectedComponents; @@ -308,7 +307,7 @@ const Args::CtRoot RpcHandler::GetComponentsTree(const string& context, bool all return ctRoot; } -const bool RpcHandler::SelectComponent(const string& context, const string& id, int count) { +bool RpcHandler::SelectComponent(const string& context, const string& id, int count) { // first try full component ID RteComponent* rteComponent = GetContext(context).rteActiveTarget->GetComponent(id); if(rteComponent) { @@ -317,15 +316,15 @@ const bool RpcHandler::SelectComponent(const string& context, const string& id, return GetActiveTarget(context)->SelectComponent(GetComponentAggregate(context, id), count, true); } -const bool RpcHandler::SelectVariant(const string& context, const string& id, const string& variant) { +bool RpcHandler::SelectVariant(const string& context, const string& id, const string& variant) { return SelectVariantOrVersion(context, id, variant, true); } -const bool RpcHandler::SelectVersion(const string& context, const string& id, const string& version) { +bool RpcHandler::SelectVersion(const string& context, const string& id, const string& version) { return SelectVariantOrVersion(context, id, version, false); } -const bool RpcHandler::SelectVariantOrVersion(const string& context, const string& id, const string& value, bool bVariant) { +bool RpcHandler::SelectVariantOrVersion(const string& context, const string& id, const string& value, bool bVariant) { RteComponentAggregate* rteAggregate = GetComponentAggregate(context, id); auto& selectedValue = bVariant ? rteAggregate->GetSelectedVariant() : rteAggregate->GetSelectedVersion(); @@ -352,7 +351,7 @@ const bool RpcHandler::SelectVariantOrVersion(const string& context, const strin -const bool RpcHandler::SelectBundle(const string& context, const string& className, const string& bundleName) { +bool RpcHandler::SelectBundle(const string& context, const string& className, const string& bundleName) { RteTarget* rteTarget = GetActiveTarget(context); RteComponentClass* rteClass = rteTarget->GetComponentClass(className); if(!rteClass) { @@ -364,26 +363,26 @@ const bool RpcHandler::SelectBundle(const string& context, const string& classNa } -const Args::Results RpcHandler::ValidateComponents(const string& context) { +RpcArgs::Results RpcHandler::ValidateComponents(const string& context) { auto contextItem = GetContext(context); if (!m_worker.CheckRteErrors()) { throw JsonRpcException(RTE_MODEL_ERROR, "rte model reported error"); } - Args::Results results; + RpcArgs::Results results; if (!m_worker.ValidateContext(contextItem)) { - results.validation = vector{}; + results.validation = vector{}; for (const auto& validation : contextItem.validationResults) { - Args::Result r; + RpcArgs::Result r; r.result = RteItem::ConditionResultToString(validation.result); r.id = validation.id; if (!validation.aggregates.empty()) { r.aggregates = vector(validation.aggregates.begin(), validation.aggregates.end()); } if (!validation.conditions.empty()) { - Args::Condition c; - r.conditions = vector{}; + RpcArgs::Condition c; + r.conditions = vector{}; for (const auto& condition : validation.conditions) { c.expression = condition.expression; if (!condition.aggregates.empty()) { @@ -398,7 +397,7 @@ const Args::Results RpcHandler::ValidateComponents(const string& context) { return results; } -const Args::LogMessages RpcHandler::GetLogMessages(void) { +RpcArgs::LogMessages RpcHandler::GetLogMessages(void) { StrVec infoVec; for (const auto& [_, info] : ProjMgrLogger::Get().GetInfos()) { for (const auto& msg : info) { @@ -417,7 +416,7 @@ const Args::LogMessages RpcHandler::GetLogMessages(void) { CollectionUtils::PushBackUniquely(warningsVec, msg); } } - Args::LogMessages messages; + RpcArgs::LogMessages messages; if (!infoVec.empty()) { messages.info = infoVec; } diff --git a/tools/projmgr/src/ProjMgrRpcServerData.cpp b/tools/projmgr/src/ProjMgrRpcServerData.cpp index a1238234b..5d7994c54 100644 --- a/tools/projmgr/src/ProjMgrRpcServerData.cpp +++ b/tools/projmgr/src/ProjMgrRpcServerData.cpp @@ -15,7 +15,7 @@ #include "CollectionUtils.h" -using namespace Args; +using namespace RpcArgs; template T FromRteItem(const string& id, RteItem* rteItem) { @@ -37,10 +37,10 @@ RpcDataCollector::RpcDataCollector(RteTarget* t) : { } -Args::Component RpcDataCollector::FromRteComponent(const RteComponent* rteComponent) const{ - Args::Component c; +RpcArgs::Component RpcDataCollector::FromRteComponent(const RteComponent* rteComponent) const{ + RpcArgs::Component c; c.id = rteComponent->GetComponentID(true); - c.fromPack = rteComponent->GetPackageID(true); + c.pack = rteComponent->GetPackageID(true); const auto& description = rteComponent->GetDescription(); if (!description.empty()) { c.description = description; @@ -59,7 +59,7 @@ Args::Component RpcDataCollector::FromRteComponent(const RteComponent* rteCompon return c; } -Args::ComponentInstance RpcDataCollector::FromComponentInstance(const RteComponentInstance* rteCi) const { +RpcArgs::ComponentInstance RpcDataCollector::FromComponentInstance(const RteComponentInstance* rteCi) const { ComponentInstance ci; if(rteCi) { ci.id = rteCi->GetDisplayName(); @@ -85,7 +85,7 @@ RteItem* RpcDataCollector::GetTaxonomyItem(const RteComponentGroup* rteGroup) co return nullptr; } -void RpcDataCollector::CollectUsedItems(Args::UsedItems& usedItems) const { +void RpcDataCollector::CollectUsedItems(RpcArgs::UsedItems& usedItems) const { auto rteProject = m_target ? m_target->GetProject() : nullptr; if(!rteProject) { @@ -105,7 +105,7 @@ void RpcDataCollector::CollectUsedItems(Args::UsedItems& usedItems) const { } -void RpcDataCollector::CollectCtClasses(Args::CtRoot& root) const { +void RpcDataCollector::CollectCtClasses(RpcArgs::CtRoot& root) const { auto classContainer = m_target ? m_target->GetClasses() : nullptr; if(!classContainer) { @@ -113,7 +113,7 @@ void RpcDataCollector::CollectCtClasses(Args::CtRoot& root) const { } for(auto [name, rteClass] : classContainer->GetGroups()) { - Args::CtClass ctClass; + RpcArgs::CtClass ctClass; ctClass.name = name; auto activeBundle = rteClass->GetSelectedBundleName(); ctClass.activeBundle = activeBundle; @@ -126,7 +126,7 @@ void RpcDataCollector::CollectCtClasses(Args::CtRoot& root) const { } } -void RpcDataCollector::CollectCtBundles(Args::CtClass& ctClass, RteComponentGroup* rteClass) const { +void RpcDataCollector::CollectCtBundles(RpcArgs::CtClass& ctClass, RteComponentGroup* rteClass) const { for(auto [bundleName, bundleId] : rteClass->GetBundleNames()) { m_target->GetFilteredBundles(); CtBundle ctBundle; @@ -141,7 +141,7 @@ void RpcDataCollector::CollectCtBundles(Args::CtClass& ctClass, RteComponentGrou } } -void RpcDataCollector::CollectCtChildren(Args::CtTreeItem& parent, RteComponentGroup* parentRteGroup, const string& bundleName) const +void RpcDataCollector::CollectCtChildren(RpcArgs::CtTreeItem& parent, RteComponentGroup* parentRteGroup, const string& bundleName) const { // collect aggregates to this level CollectCtAggregates(parent, parentRteGroup, bundleName); @@ -149,7 +149,7 @@ void RpcDataCollector::CollectCtChildren(Args::CtTreeItem& parent, RteComponentG if(rteGroups.empty()) { return; } - vector groups; + vector cgroups; for(auto [name, rteGroup] : rteGroups) { if(!rteGroup->HasBundleName(bundleName)) { continue; @@ -168,12 +168,12 @@ void RpcDataCollector::CollectCtChildren(Args::CtTreeItem& parent, RteComponentG CollectCtChildren(g, rteGroup, bundleName); CollectCtAggregates(g, rteGroup,bundleName); // add to parent collection - groups.push_back(g); + cgroups.push_back(g); } - parent.groups = groups; + parent.cgroups = cgroups; } -void RpcDataCollector::CollectCtAggregates(Args::CtTreeItem& parent, RteComponentGroup* parentRteGroup, const string& bundleName) const +void RpcDataCollector::CollectCtAggregates(RpcArgs::CtTreeItem& parent, RteComponentGroup* parentRteGroup, const string& bundleName) const { // aggregates vector aggregates; @@ -208,7 +208,7 @@ void RpcDataCollector::CollectCtAggregates(Args::CtTreeItem& parent, RteComponen } } -void RpcDataCollector::CollectCtVariants(Args::CtAggregate& ctAggregate, RteComponentAggregate* rteAggregate) const +void RpcDataCollector::CollectCtVariants(RpcArgs::CtAggregate& ctAggregate, RteComponentAggregate* rteAggregate) const { for(auto& variantName : rteAggregate->GetVariants()) { CtVariant v;