]> Creatis software - crea.git/blob - lib/creaDevManagerLib/modelCDMAppli.h
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMAppli.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 #                        pour la Sant�)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 #
10 #  This software is governed by the CeCILL-B license under French law and
11 #  abiding by the rules of distribution of free software. You can  use,
12 #  modify and/ or redistribute the software under the terms of the CeCILL-B
13 #  license as circulated by CEA, CNRS and INRIA at the following URL
14 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 #  or in the file LICENSE.txt.
16 #
17 #  As a counterpart to the access to the source code and  rights to copy,
18 #  modify and redistribute granted by the license, users are provided only
19 #  with a limited warranty  and the software's author,  the holder of the
20 #  economic rights,  and the successive licensors  have only  limited
21 #  liability.
22 #
23 #  The fact that you are presently reading this means that you have had
24 #  knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
26  */
27
28 /*
29  * modelCDMAppli.h
30  *
31  *  Created on: Nov 23, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #ifndef MODELCDMAPPLI_H_
36 #define MODELCDMAPPLI_H_
37
38 #include<iostream>
39 #include<vector>
40 #include<map>
41
42 #include"modelCDMFolder.h"
43 #include"modelCDMApplication.h"
44
45 /**
46  * Represents the appli folder of Crea project. The appli folder holds the applications of a project.
47  */
48 class modelCDMAppli : public modelCDMFolder
49 {
50 public:
51   /**
52    * Default constructor.
53    */
54   modelCDMAppli();
55   /**
56    * Constructor of the appli folder node.
57    * @param parent Parent node of the appli node.
58    * @param path Full path of the appli node.
59    * @param name Folder name of the appli node. By default "appli"
60    * @param level Folder Level in the project hierarchy. By default 1
61    */
62   modelCDMAppli(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name = "appli", const int& level = 1);
63   /**
64    * Destructor.
65    */
66   ~modelCDMAppli();
67
68   /**
69    * Retrieves the applications inside the appli folder node.
70    * @return Reference array of the applications in the appli node.
71    */
72   const std::vector<modelCDMApplication*>& GetApplications() const;
73
74   /**
75    * Creates a new application in the system and creates an application node. This node is stored in the applications attribute and returned.
76    * @param name Name of the new application.
77    * @param type 0=console application, 1=GUI Application (wxWidgets).
78    * @param result Result message of the operation.
79    * @return Reference to the created application or NULL.
80    */
81   modelCDMApplication* CreateApplication(
82       const std::string& name,
83       const int& type,
84       std::string*& result
85   );
86   /**
87    * Refreshes the file structure of the appli node. Deletes deleted folders and files and creates created files and folders since lasts refresh.
88    * @param result Result message of the operation.
89    * @return True if the operation was successful.
90    */
91   virtual const bool Refresh(std::string*& result);
92
93   /**
94    * Checks the CMakeLists structure and the applications in order to look for compilation errors before compiling.
95    * @param properties Properties found in the structure.
96    */
97   void CheckStructure(std::map<std::string, bool>& properties);
98
99 private:
100   /**
101    * application in the appli folder node.
102    */
103   std::vector<modelCDMApplication*> applications;
104 };
105
106 #endif /* MODELCDMAPPLI_H_ */