X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcreaDevManagerLib%2FmodelCDMApplication.h;h=9693066078d857c869e72474fa635c651ecbce6c;hb=f3f98131ffd23351c3cd872a0b04aecdc97b7c92;hp=a30517d26e727bcbcf09be402e8d9255c7dfbec3;hpb=667f8ae6982afb3a65dc1e1fad8c3aabdf0caf80;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMApplication.h b/lib/creaDevManagerLib/modelCDMApplication.h index a30517d..9693066 100644 --- a/lib/creaDevManagerLib/modelCDMApplication.h +++ b/lib/creaDevManagerLib/modelCDMApplication.h @@ -37,33 +37,112 @@ #include #include +#include -#include"modelCDMIProjectTreeNode.h" +#include "modelCDMFolder.h" +#include "modelCDMFile.h" +#include "modelCDMCodeFile.h" -class modelCDMApplication : public modelCDMIProjectTreeNode +/** + * Class representing an application in a Crea project. An Application is an stand alone application that uses the project libraries to show their functionalities. + */ +class modelCDMApplication : public modelCDMFolder { public: + /** + * Default Constructor. + */ modelCDMApplication(); - modelCDMApplication(const std::string& path, const int& level = 2); + /** + * Application Constructor + * @param parent Parent node of the application node. + * @param path Full path of the application node. + * @param name Name of the applcation folder node. + * @param level Level of the application node folder in the project. + */ + modelCDMApplication(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 2); + /** + * Destructor. + */ ~modelCDMApplication(); - const std::string& GetNameApplication() const; - const std::string& GetMainFile() const; + /** + * Returns the executable name of the application node + * @return + */ + const std::string& GetExecutableName() const; + /** + * Returns the main source file of the application node. That is, the file that contains the main method. + * @return File reference to main file. + */ + modelCDMFile* GetMainFile() const; + + /** + * Sets the executable name for the application. + * @param fileName Name of the application executable. + * @param result Result message. + * @return True if the operation was successful. + */ + bool SetExecutableName(const std::string& fileName, std::string*& result); - void SetMainFile(const std::string& fileName); + /** + * Creates a folder in the application folder node. This takes effect in the system as well as in the project model. + * @param name Name of the new folder. + * @param result Result message. + * @return True if the operation was successful. + */ + modelCDMFolder* CreateFolder(const std::string& name, std::string*& result); - bool CreateFolder( - const std::string& name, - std::string*& result, - const std::string& path = "/" - ); - bool OpenCMakeListsFile(std::string* & result); + /** + * Refreshes the structure of the application. Removes folders and files deleted since the last refresh. Also, adds folders and files created since the las refresh. + * @param result Result message. + * @return True if the operation was successful. + */ virtual const bool Refresh(std::string*& result); + /** + * Checks the CMakeLists file and the application structure to identify registration errors before compiling the project. + * @param properties Properties found in the structure. + */ + void CheckStructure(std::map& properties); + + /** + * Checks the application's CMakeLists file to check which third party libraries are enabled. + * @return A map with the name of the library and if it's included in the CMakeLists file. + */ + std::map Get3rdPartyLibraries(); + + /** + * Sets the 3rd party library inclusion in the application's CMakeLists file. + * @return if the operation was successful. + */ + bool Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude); + + /** + * Checks the application's CMakeLists file to check which custom libraries are enabled. + * @return A map with the name of the library and if it's included in the CMakeLists file. + */ + std::map GetCustomLibraries(); + + /** + * Sets the custom library inclusion in the application's CMakeLists file. + * @return if the operation was successful. + */ + bool SetCustomLibrary(const std::string& library_name, const bool& toInclude); + private: - std::string nameApplication; - std::string mainFile; - std::vector applications; + /** + * Name of the application executable file. + */ + std::string executableName; + /** + * Reference to the main file of the application. + */ + modelCDMFile* mainFile; + /** + * Reference array of the children folders of the application. + */ + std::vector folders; }; #endif /* MODELCDMAPPLICATION_H_ */