1 /*=========================================================================
3 Program: ConceptInstantHandler
4 Module: $RCSfile: ConceptInstantHandler.h,v $
6 Date: $Date: 2010/02/08 15:24:05 $
7 Version: $Revision: 1.7 $
8 Objective: Wrapper fo the concepts that subscribe to the instant handler
9 Author: 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 =========================================================================*/
40 #ifndef __CONCEPTINSTANTHANDLER_H_INCLUDED__
41 #define __CONCEPTINSTANTHANDLER_H_INCLUDED__
45 #ifdef creaEnvironment_BUILD_SHARED
46 #define creaEnvironment_EXPORTS __declspec( dllexport )
48 #define creaEnvironment_EXPORTS
51 #define creaEnvironment_EXPORTS
55 class creaEnvironment_EXPORTS ConceptInstantHandler
58 //===== CONSTANTS ========
60 * if the concept is being reproduced in real time
62 const static int REAL_TIME=1;
64 * if the concept is being reproduced by doing
65 * plus plus to its indexes
67 const static int PLUS_PLUS=2;
70 //====== LIFECYCLE ========
71 ConceptInstantHandler(std::string name,int mode,int positionInReproduction);
72 ~ConceptInstantHandler();
73 //====== OPERATIONS =======
75 * change the actual index by increasing
76 * the index until the maximum by the increaseValue
80 * change the actual index by decreasing
81 * the index until zero by the decreaseValue
85 //====== INQUIRY =========
89 std::string getName();
91 * @return PositionInReproduction
99 * @return increaseValue
101 int getIncreaseValue();
104 * @return decreaseValue
106 int getDecreaseValue();
109 * @return indexInInstant
111 int getIndexInInstant();
113 * @return actualIndex
117 * @return maximumIndex
120 int getMaximumIndex();
122 * @return timeReproduction
124 double getTimeReproduction();
131 * if the actual index is not the maximum index
135 * if the actual index is not zero
137 bool hasPreviousIndex();
142 double getInitialTime();
145 //====== ACCESS ==========
147 * Sets the name of the concept
148 * @param name, new name
150 void setName(std::string name);
152 * Sets the position of the concept
155 void setPosition(int position);
157 * Sets the mode of the concept
158 * @param mode, new mode= REAL_TIME or
161 void setMode(int mode);
163 * Set Increase of the concept
164 * @param increaseValue
166 void setIncreaseValue(int increaseValue);
169 * Set decrease of the concept
170 * @param decreaseValue
172 void setDecreaseValue(int decreaseValue);
175 * Sets the index of the concept in the instant
176 * @param indexInInstant
178 void setIndexInInstant(int indexInInstant);
180 * Sets sets the maximum value
181 * @param maximumIndex
183 void setMaximumIndex(int maximumIndex);
185 * set the actualIndex
188 void setActualIndex(int index);
190 * set the timeReproduction
193 void setTimeReproduction(double time);
198 void setScale(double scale);
203 void setActualTime(double actualTime);
205 * reset the initial time
207 void resetInitialTime();
209 * Sets the initial time
211 void setInitialTime(double time);
216 //======= ATTRIBUTES=======
219 * Name of the concept
223 * Mode of changing the instant
230 * position in the reproduction
232 int positionInReproduction;
234 * Increment for an instant
239 * Decrease for an instant
252 * maximum index that can have in the instant
256 * Time in miliseconds of the reproduction
258 double timeReproduction;
260 * Scale use for calculate the index
261 * of the concept according to the time of reproduction
262 * defined in timeReproduction
263 * scaleTime=maximumIndex/timeReproduction
267 * actual time of the reproduction
277 //====== PRIVATE METHODS=========