1 /*=========================================================================
3 Program: ConceptInstantHandler
4 Module: $RCSfile: ConceptInstantHandler.h,v $
6 Date: $Date: 2008/11/24 10:23:53 $
7 Version: $Revision: 1.6 $
8 Objective: Wrapper fo the concepts that subscribe to the instant handler
9 Authot: Monica Maria Lozano Romero
14 This software is distributed WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the above copyright notice for more information.
19 =========================================================================*/
44 #ifndef __CONCEPTINSTANTHANDLER_H_INCLUDED__
45 #define __CONCEPTINSTANTHANDLER_H_INCLUDED__
49 #ifdef creaEnvironment_BUILD_SHARED
50 #define creaEnvironment_EXPORTS __declspec( dllexport )
52 #define creaEnvironment_EXPORTS
55 #define creaEnvironment_EXPORTS
59 class creaEnvironment_EXPORTS ConceptInstantHandler
62 //===== CONSTANTS ========
64 * if the concept is being reproduced in real time
66 const static int REAL_TIME=1;
68 * if the concept is being reproduced by doing
69 * plus plus to its indexes
71 const static int PLUS_PLUS=2;
74 //====== LIFECYCLE ========
75 ConceptInstantHandler(std::string name,int mode,int positionInReproduction);
76 ~ConceptInstantHandler();
77 //====== OPERATIONS =======
79 * change the actual index by increasing
80 * the index until the maximum by the increaseValue
84 * change the actual index by decreasing
85 * the index until zero by the decreaseValue
90 //====== INQUIRY =========
94 std::string getName();
96 * @return PositionInReproduction
104 * @return increaseValue
106 int getIncreaseValue();
109 * @return decreaseValue
111 int getDecreaseValue();
114 * @return indexInInstant
116 int getIndexInInstant();
118 * @return actualIndex
122 * @return maximumIndex
125 int getMaximumIndex();
127 * @return timeReproduction
129 double getTimeReproduction();
136 * if the actual index is not the maximum index
140 * if the actual index is not zero
142 bool hasPreviousIndex();
147 double getInitialTime();
150 //====== ACCESS ==========
152 * Sets the name of the concept
153 * @param name, new name
155 void setName(std::string name);
157 * Sets the position of the concept
160 void setPosition(int position);
162 * Sets the mode of the concept
163 * @param mode, new mode= REAL_TIME or
166 void setMode(int mode);
168 * Set Increase of the concept
169 * @param increaseValue
171 void setIncreaseValue(int increaseValue);
174 * Set decrease of the concept
175 * @param decreaseValue
177 void setDecreaseValue(int decreaseValue);
180 * Sets the index of the concept in the instant
181 * @param indexInInstant
183 void setIndexInInstant(int indexInInstant);
185 * Sets sets the maximum value
186 * @param maximumIndex
188 void setMaximumIndex(int maximumIndex);
190 * set the actualIndex
193 void setActualIndex(int index);
195 * set the timeReproduction
198 void setTimeReproduction(double time);
203 void setScale(double scale);
208 void setActualTime(double actualTime);
210 * reset the initial time
212 void resetInitialTime();
214 * Sets the initial time
216 void setInitialTime(double time);
221 //======= ATTRIBUTES=======
224 * Name of the concept
228 * Mode of changing the instant
235 * position in the reproduction
237 int positionInReproduction;
239 * Increment for an instant
244 * Decrease for an instant
257 * maximum index that can have in the instant
261 * Time in miliseconds of the reproduction
263 double timeReproduction;
265 * Scale use for calculate the index
266 * of the concept according to the time of reproduction
267 * defined in timeReproduction
268 * scaleTime=maximumIndex/timeReproduction
272 * actual time of the reproduction
284 //====== PRIVATE METHODS=========