]> Creatis software - crea.git/blob - lib/creaDevManagerLib/modelCDMBlackBox.h
Feature #1711 CreaDevManager application implementation
[crea.git] / lib / creaDevManagerLib / modelCDMBlackBox.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  * modelCDMBlackBox.h
30  *
31  *  Created on: Nov 23, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #ifndef MODELCDMBLACKBOX_H_
36 #define MODELCDMBLACKBOX_H_
37
38 #include<iostream>
39
40 #include"modelCDMFolder.h"
41
42 /**
43  * Class representing a black box inside a Crea project. A black box is modular construct that uses the project libraries to execute its operations
44  */
45 class modelCDMBlackBox : public modelCDMFolder
46 {
47 public:
48   /**
49    * Default Constructor.
50    */
51   modelCDMBlackBox();
52   /**
53    * Black Box Constructor.
54    * @param parent parent node of the black box node.
55    * @param path Path of the source folder of the black box node.
56    * @param name Name of the black box node.
57    * @param level Hierarchy level of the black box node in the project. By default 3
58    */
59   modelCDMBlackBox(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 3);
60   /**
61    * Destructor.
62    */
63   ~modelCDMBlackBox();
64
65   /**
66    * Returns the name of the black box node.
67    * @return Name of the black box node.
68    */
69   const std::string& GetNameBlackBox() const;
70   /**
71    * Retrieves the black box authors' names.
72    * @return Names of the black box node authors.
73    */
74   const std::string& GetAuthors() const;
75   /**
76    * Retrieves the categories of the black box.
77    * @return Categories associated with the black box.
78    */
79   const std::string& GetCategories() const;
80   /**
81    * Returns the description of the black box purpose.
82    * @return Description of the black box.
83    */
84   const std::string& GetDescription() const;
85
86   /**
87    * Returns a reference of the header file of the black box.
88    * @return Header file of the black box.
89    */
90   modelCDMFile* GetHeaderFile() const;
91   /**
92    * Returns a reference of the source file of the black box.
93    * @return Source file of the black box.
94    */
95   modelCDMFile* GetSourceFile() const;
96
97   /**
98    * Sets the name of the black box with the one provided.
99    * @param name New name of the black box.
100    * @param result Result message.
101    * @return True if the operation was successful.
102    */
103   bool SetNameBlackBox(const std::string& name, std::string*& result);
104   /**
105    * Sets the authors' names of the black box to the ones given.
106    * @param authors Authors' names.
107    * @param result Result message.
108    * @return True if the operation was successful.
109    */
110   bool SetAuthors(const std::string& authors, std::string*& result);
111   /**
112    * Sets the Categories associated with the black box to the given ones.
113    * @param categories Categories associated with the black box.
114    * @param result Result message
115    * @return True if the operation was successful.
116    */
117   bool SetCategories(const std::string& categories, std::string*& result);
118   /**
119    * Sets the Description of the black box to the given one.
120    * @param description Description of the black box.
121    * @param result Result message.
122    * @return True if the operation was successful.
123    */
124   bool SetDescription(const std::string& description, std::string*& result);
125
126   /**
127    * Sets the reference of the header file.
128    * @param file Reference to the Header file.
129    */
130   void SetHeaderFile(modelCDMFile* file);
131   /**
132    * Sets the reference of the source file.
133    * @param file Reference to the source file.
134    */
135   void SetSourceFile(modelCDMFile* file);
136
137
138   /**
139    * Opens the source file with the system default code editor
140    * @param result Result message.
141    * @return True if the operation was successful.
142    */
143   bool OpenCxx(std::string*& result);
144   /**
145    * Opens the header file with the system default code editor
146    * @param result Result message.
147    * @return True if the operation was successful.
148    */
149   bool OpenHxx(std::string*& result);
150   /**
151    * Refreshes the structure and properties of the black box.
152    * @param result Result message.
153    * @return True if the operation was successful.
154    */
155   const bool Refresh(std::string*& result);
156
157 private:
158   /**
159    * Name of the black box. It might be different from the header file name.
160    */
161   std::string nameBlackBox;
162   /**
163    * Authors of the black box.
164    */
165   std::string authors;
166   /**
167    * Categories associated to the categories.
168    */
169   std::string categories;
170   /**
171    * Description of the black box.
172    */
173   std::string description;
174
175   /**
176    * Reference to the header file of the black box.
177    */
178   modelCDMFile* header;
179   /**
180    * Reference to the source file of the black box.
181    */
182   modelCDMFile* source;
183 };
184
185 #endif /* MODELCDMBLACKBOX_H_ */