2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------
31 * Created on: Nov 23, 2012
32 * Author: Daniel Felipe Gonzalez
35 #ifndef MODELCDMPACKAGE_H_
36 #define MODELCDMPACKAGE_H_
42 #include"modelCDMFolder.h"
43 #include"modelCDMPackageSrc.h"
46 * Class representing a package of a Crea project.
48 class modelCDMPackage : public modelCDMFolder
52 * Default constructor.
56 * Package node constructor.
57 * @param parent Parent node of the package folder node.
58 * @param path Full path to the package.
59 * @param name Name of the package folder.
60 * @param level Project hierarchy level of the package node.
62 modelCDMPackage(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 1);
69 * Retrieves the name of the package. the name of the package can be different from the package folder name.
70 * @return Package name.
72 const std::string& GetNamePackage() const;
74 * Retrieves the authors of the package.
75 * @return Package authors.
77 const std::string& GetAuthors() const;
79 * Retrieves the Author e-mails of the package.
80 * @return Author e-mails.
82 const std::string& GetAuthorsEmail() const;
84 * Retrieves the version of the package.
85 * @return Package version.
87 const std::string& GetVersion() const;
89 * Retrieves the description of the package.
90 * @return Package description
92 const std::string& GetDescription() const;
94 * Retrieves the src folder node of the package node.
95 * @return Reference to the package src file node.
97 modelCDMPackageSrc* GetSrc() const;
100 * Sets the name of the package authors. This operation affects the project model as well as the system files.
101 * @param authors Name of the package authors.
102 * @param result Result message
103 * @return True if the operation was successful.
105 bool SetAuthors(const std::string& authors, std::string*& result);
107 * Sets the email of the package authors. This operation affects the project model as well as the system files.
109 * @param result Result message
110 * @return True if the operation was successful.
112 bool SetAuthorsEmail(const std::string& email, std::string*& result);
114 * Sets the version of the package. This operation affects the project model as well as the system files.
116 * @param result Result message
117 * @return True if the operation was successful.
119 bool SetVersion(const std::string& version, std::string*& result);
121 * Sets the description of the package. This operation affects the project model as well as the system files.
123 * @param result Result message
124 * @return True if the operation was successful.
126 bool SetDescription(const std::string& description, std::string*& result);
130 * Creates a new black box and returns a reference to it if the creation is successful. This operation affects the project model as well as the system files.
131 * @param result Result message
132 * @param name New black box name.
133 * @param type Black box type.
134 * @param format Black box format.
135 * @param categories Categories associated to this black box.
136 * @param authors Black box authors' name.
137 * @param authorsEmail Black box authors' email.
138 * @param description Black box description.
139 * @return True if the operation was successful.
141 modelCDMBlackBox* CreateBlackBox(
142 std::string*& result,
143 const std::string& name,
144 const std::string& type = "std",
145 const std::string& format = "C++",
146 const std::string& categories = "empty",
147 const std::string& authors = "unknown",
148 const std::string& authorsEmail = "",
149 const std::string& description = "no description"
152 * Refreshes the structure of the package folder node. This method updates the properties of the package as well as it refreshes its children.
153 * @param result Result message
154 * @return True if the operation was successful.
156 virtual const bool Refresh(std::string*& result);
159 * Checks the package structure with the CMakeLists file to look for project structure definition problems before compiling the project.
160 * @param properties Project properties.
162 void CheckStructure(std::map<std::string, bool>& properties);
165 * Checks the package's CMakeLists file to check which third party libraries are enabled.
166 * @return A map with the name of the library and if it's included in the CMakeLists file.
168 std::map<std::string, bool> Get3rdPartyLibraries();
171 * Sets the 3rd party library inclusion in the CMakeLists file.
172 * @return if the operation was successful.
174 bool Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude);
177 * Checks the package CMakeLists file to check which custom libraries are enabled.
178 * @return A map with the name of the library and if it's included in the CMakeLists file.
180 std::map<std::string, bool> GetCustomLibraries();
183 * Sets the custom library inclusion in the CMakeLists file.
184 * @return if the operation was successful.
186 bool SetCustomLibrary(const std::string& library_name, const bool& toInclude);
192 std::string namePackage;
194 * Package authors' name.
198 * Package authors' e-mails.
200 std::string authorsEmail;
206 * Package description.
208 std::string description;
210 * Reference to the package source folder.
212 modelCDMPackageSrc* src;
216 #endif /* MODELCDMPACKAGE_H_ */