]> Creatis software - creaEnvironment.git/blob - lib/kernel_Environment/Instant.h
537c032b5f9f037249f7b1d62d3e3f5854f050a4
[creaEnvironment.git] / lib / kernel_Environment / Instant.h
1
2
3 // SYSTEM INCLUDES
4
5 /*
6         #include <iostream>
7         #include <vector>
8 */
9
10 // PROJECT INCLUDES
11
12
13 // LOCAL INCLUDES
14
15
16 // FORWARD REFERENCES
17
18
19
20
21 #ifndef __INSTANT_H_INCLUDED__
22 #define  __INSTANT_H_INCLUDED__
23
24 #include "ConceptInstantHandler.h"
25
26 class creaEnvironment_EXPORTS Instant
27         {
28                 public:
29                         
30                         
31                         //====== LIFECYCLE ========
32                         Instant(std::vector<int>* instant);
33                         Instant();
34                         Instant(int size);
35                         ~Instant();     
36
37                         //====== OPERATIONS =======
38                         /*
39                         * Add a new concept to the instant
40                         * @param indexConcept: index concept that is going
41                         * to be added of the new concept added to the instant
42                         * @return --
43                         * 
44                         */
45                         void addConcept(int value);
46                         //======= INQUIRY ===========
47                         /*
48                         * Returns the value nTuple
49                         * @return nTuple
50                         */
51                         std::vector<int>* getInstant();
52                         /*
53                         * Returns the index of the concept that's
54                         * in the instant's  concept index
55                         * @param indexConcept: index of the concept in the instant
56                         * @return indexInConcept
57                         */
58                         int getIndexInConcept(int indexConcept);
59                         
60                         /*
61                         * returns the number of concepts that the instant has
62                         * @return nTuple.size()
63                         */
64                         int getSize();
65                         
66                         
67                         /*
68                         * Compares if the instant given is equals to the nTuple
69                         * @param instant: instant for compare
70                         * @return true if is equals to the nTuple, false otherwise
71                         */
72                         bool isEquals(Instant* instant);
73
74                         
75                         //=========== ACCESS ==========
76                         /*
77                         * Sets the nTuple
78                         * @param instant: the vector that's going to be save in
79                         * nTuple        
80                         */
81                         void setInstant(std::vector<int>* instant);
82                         
83                         /*
84                         * Change the  concept's index saved in the nTuple index (the index
85                         * that's is for that concept
86                         * @param indexConcept: Concept that's going to change the value
87                         * @return--
88                         * 
89                         */
90                         void setConcept(int indexConcept, int index);
91                         /*
92                         * remove a concept from the instant
93                         * @param indexConcept: Concept that's going to be removec
94                         * @return true if succesful, false otherwise
95                         * 
96                         */
97                         bool removeConcept(int indexConcept);
98
99                 private:
100                         
101                         //=========== ATTRIBUTES==========
102                         /*
103                         * The vector that's represent an instant according to the
104                         * number of concepts that are already defined
105                         * EXAMPLE
106                         * concepts: (time,patient), and time's size is 2, patients's size is 2
107                         * then an possible instant is (1,2)
108                         * 
109                         */
110                         std::vector<int>* nTuple;
111                         
112
113         };
114 #endif
115
116
117