]> Creatis software - creaEnvironment.git/blob - lib/kernel_Environment/Instant.h
License Files Headers
[creaEnvironment.git] / lib / kernel_Environment / Instant.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 // SYSTEM INCLUDES
30
31 /*
32         #include <iostream>
33         #include <vector>
34 */
35
36 // PROJECT INCLUDES
37
38
39 // LOCAL INCLUDES
40
41
42 // FORWARD REFERENCES
43
44
45
46
47 #ifndef __INSTANT_H_INCLUDED__
48 #define  __INSTANT_H_INCLUDED__
49
50 #include "ConceptInstantHandler.h"
51
52 class creaEnvironment_EXPORTS Instant
53         {
54                 public:
55                         
56                         
57                         //====== LIFECYCLE ========
58                         Instant(std::vector<int>* instant);
59                         Instant();
60                         Instant(int size);
61                         ~Instant();     
62
63                         //====== OPERATIONS =======
64                         /*
65                         * Add a new concept to the instant
66                         * @param indexConcept: index concept that is going
67                         * to be added of the new concept added to the instant
68                         * @return --
69                         * 
70                         */
71                         void addConcept(int value);
72                         //======= INQUIRY ===========
73                         /*
74                         * Returns the value nTuple
75                         * @return nTuple
76                         */
77                         std::vector<int>* getInstant();
78                         /*
79                         * Returns the index of the concept that's
80                         * in the instant's  concept index
81                         * @param indexConcept: index of the concept in the instant
82                         * @return indexInConcept
83                         */
84                         int getIndexInConcept(int indexConcept);
85                         
86                         /*
87                         * returns the number of concepts that the instant has
88                         * @return nTuple.size()
89                         */
90                         int getSize();
91                         
92                         
93                         /*
94                         * Compares if the instant given is equals to the nTuple
95                         * @param instant: instant for compare
96                         * @return true if is equals to the nTuple, false otherwise
97                         */
98                         bool isEquals(Instant* instant);
99
100                         
101                         //=========== ACCESS ==========
102                         /*
103                         * Sets the nTuple
104                         * @param instant: the vector that's going to be save in
105                         * nTuple        
106                         */
107                         void setInstant(std::vector<int>* instant);
108                         
109                         /*
110                         * Change the  concept's index saved in the nTuple index (the index
111                         * that's is for that concept
112                         * @param indexConcept: Concept that's going to change the value
113                         * @return--
114                         * 
115                         */
116                         void setConcept(int indexConcept, int index);
117                         /*
118                         * remove a concept from the instant
119                         * @param indexConcept: Concept that's going to be removec
120                         * @return true if succesful, false otherwise
121                         * 
122                         */
123                         bool removeConcept(int indexConcept);
124
125                 private:
126                         
127                         //=========== ATTRIBUTES==========
128                         /*
129                         * The vector that's represent an instant according to the
130                         * number of concepts that are already defined
131                         * EXAMPLE
132                         * concepts: (time,patient), and time's size is 2, patients's size is 2
133                         * then an possible instant is (1,2)
134                         * 
135                         */
136                         std::vector<int>* nTuple;
137                         
138
139         };
140 #endif
141
142
143