@@ -794,6 +794,62 @@ class ProjMgrWorker {
794794 */
795795 bool CheckRteErrors (void );
796796
797+ /* *
798+ * @brief load packs
799+ * @param context item
800+ * @return true if there is no error
801+ */
802+ bool LoadPacks (ContextItem& context);
803+
804+ /* *
805+ * @brief set target attributes
806+ * @param context item
807+ * @param map of attributes
808+ * @return true if there is no error
809+ */
810+ bool SetTargetAttributes (ContextItem& context, std::map<std::string, std::string>& attributes);
811+
812+ /* *
813+ * @brief add required components
814+ * @param context item
815+ * @return true if there is no error
816+ */
817+ bool AddRequiredComponents (ContextItem& context);
818+
819+ /* *
820+ * @brief validate context
821+ * @param context item
822+ * @return true if there is no error
823+ */
824+ bool ValidateContext (ContextItem& context);
825+
826+ /* *
827+ * @brief clear worker members for reloading a solution
828+ * @return true if there is no error
829+ */
830+ void Clear () {
831+ for (auto context : m_contexts) {
832+ for (auto componentItem : context.second .components ) {
833+ delete componentItem.second .instance ;
834+ }
835+ }
836+ m_contexts.clear ();
837+ m_ymlOrderedContexts.clear ();
838+ m_contextsPtr->clear ();
839+ m_contextErrMap.clear ();
840+ m_selectedContexts.clear ();
841+ m_outputDir.clear ();
842+ m_selectedToolchain.clear ();
843+ m_rootDir.clear ();
844+ m_undefLayerVars.clear ();
845+ m_packMetadata.clear ();
846+ m_executes.clear ();
847+ m_toolchainErrors.clear ();
848+ m_selectableCompilers.clear ();
849+ m_missingFiles.clear ();
850+ m_types = {};
851+ };
852+
797853protected:
798854 ProjMgrParser* m_parser = nullptr ;
799855 ProjMgrKernel* m_kernel = nullptr ;
@@ -833,7 +889,6 @@ class ProjMgrWorker {
833889 bool m_undefCompiler = false ;
834890 std::map<std::string, FileNode> m_missingFiles;
835891
836- bool LoadPacks (ContextItem& context);
837892 bool CheckMissingPackRequirements (const std::string& contextName);
838893 void CheckMissingLinkerScript (ContextItem& context);
839894 bool CollectRequiredPdscFiles (ContextItem& context, const std::string& packRoot);
@@ -844,7 +899,6 @@ class ProjMgrWorker {
844899 bool GetTypeContent (ContextItem& context);
845900 bool GetProjectSetup (ContextItem& context);
846901 bool InitializeTarget (ContextItem& context);
847- bool SetTargetAttributes (ContextItem& context, std::map<std::string, std::string>& attributes);
848902 bool ProcessPrecedences (ContextItem& context, BoardOrDevice process = BoardOrDevice::None, bool rerun = false );
849903 bool ProcessPrecedence (StringCollection& item);
850904 bool ProcessCompilerPrecedence (StringCollection& item, bool acceptRedefinition = false );
@@ -871,15 +925,13 @@ class ProjMgrWorker {
871925 bool ProcessLinkerOptions (ContextItem& context, const LinkerItem& linker, const std::string& ref);
872926 bool ProcessProcessorOptions (ContextItem& context);
873927 void AddContext (ContextDesc& descriptor, const TypePair& type, ContextItem& parentContext);
874- bool ValidateContext (ContextItem& context);
875928 bool FormatValidationResults (std::set<std::string>& results, const ContextItem& context);
876929 void UpdateMisc (std::vector<MiscItem>& vec, const std::string& compiler);
877930 void AddMiscUniquely (MiscItem& dst, std::vector<std::vector<MiscItem>*>& srcVec);
878931 void AddMiscUniquely (MiscItem& dst, std::vector<MiscItem>& srcVec);
879932 bool AddGroup (const GroupNode& src, std::vector<GroupNode>& dst, ContextItem& context, const std::string root);
880933 bool AddFile (const FileNode& src, std::vector<FileNode>& dst, ContextItem& context, const std::string root);
881934 bool AddComponent (const ComponentItem& src, const std::string& layer, std::vector<std::pair<ComponentItem, std::string>>& dst, TypePair type, ContextItem& context);
882- bool AddRequiredComponents (ContextItem& context);
883935 void GetDeviceItem (const std::string& element, DeviceItem& device) const ;
884936 void GetBoardItem (const std::string& element, BoardItem& board) const ;
885937 bool GetPrecedentValue (std::string& outValue, const std::string& element) const ;
@@ -941,6 +993,7 @@ class ProjMgrWorker {
941993 StrVec CollectSelectableCompilers ();
942994 void ProcessTmpDir (std::string& tmpdir, const std::string& base);
943995 bool IsCreatedByExecute (const std::string file, const std::string dir);
996+ bool CollectAllRequiredPdscFiles ();
944997};
945998
946999#endif // PROJMGRWORKER_H
0 commit comments