X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Fkernel_Environment%2FConceptInstantHandler.h;fp=lib%2Fkernel_Environment%2FConceptInstantHandler.h;h=6636eb19e6ab0a1551b0bb958e85e3cf1289a2b2;hb=2f2e2e1951622df36eeed906d83256ae1304d2be;hp=8c323cf7e5431ca2bcf7deeec7159cae0dd0bad1;hpb=1b79f88abf2953cbd600fe542c70ffdd0b56e336;p=creaEnvironment.git diff --git a/lib/kernel_Environment/ConceptInstantHandler.h b/lib/kernel_Environment/ConceptInstantHandler.h index 8c323cf..6636eb1 100644 --- a/lib/kernel_Environment/ConceptInstantHandler.h +++ b/lib/kernel_Environment/ConceptInstantHandler.h @@ -3,10 +3,10 @@ Program: ConceptInstantHandler Module: $RCSfile: ConceptInstantHandler.h,v $ Language: C++ - Date: $Date: 2008/11/24 10:23:53 $ - Version: $Revision: 1.6 $ + Date: $Date: 2010/02/08 15:24:05 $ + Version: $Revision: 1.7 $ Objective: Wrapper fo the concepts that subscribe to the instant handler - Authot: Monica Maria Lozano Romero + Author: Monica Maria Lozano Romero Copyright: (c) 2007 License: @@ -26,18 +26,14 @@ // PROJECT INCLUDES - - // LOCAL INCLUDES // FORWARD REFERENCES - - /* -* COMMENT -* @param -* @return +* COMMENT +* @param +* @return */ @@ -46,243 +42,240 @@ #if defined(_WIN32) - #ifdef creaEnvironment_BUILD_SHARED - #define creaEnvironment_EXPORTS __declspec( dllexport ) - #else - #define creaEnvironment_EXPORTS - #endif + #ifdef creaEnvironment_BUILD_SHARED + #define creaEnvironment_EXPORTS __declspec( dllexport ) + #else + #define creaEnvironment_EXPORTS + #endif #else - #define creaEnvironment_EXPORTS + #define creaEnvironment_EXPORTS #endif class creaEnvironment_EXPORTS ConceptInstantHandler - { - public: - //===== CONSTANTS ======== - /* - * if the concept is being reproduced in real time - */ - const static int REAL_TIME=1; - /* - * if the concept is being reproduced by doing - * plus plus to its indexes - */ - const static int PLUS_PLUS=2; - - - //====== LIFECYCLE ======== - ConceptInstantHandler(std::string name,int mode,int positionInReproduction); - ~ConceptInstantHandler(); - //====== OPERATIONS ======= - /* - * change the actual index by increasing - * the index until the maximum by the increaseValue - */ - void nextIndex(); - /* - * change the actual index by decreasing - * the index until zero by the decreaseValue - */ - void previousIndex(); - - - //====== INQUIRY ========= - /* - * @return name - */ - std::string getName(); - /* - * @return PositionInReproduction - */ - int getPosition(); - /* - * @return mode - */ - int getMode(); - /* - * @return increaseValue - */ - int getIncreaseValue(); - - /* - * @return decreaseValue - */ - int getDecreaseValue(); - - /* - * @return indexInInstant - */ - int getIndexInInstant(); - /* - * @return actualIndex - */ - int geActualIndex(); - /* - * @return maximumIndex - */ - - int getMaximumIndex(); - /* - * @return timeReproduction - */ - double getTimeReproduction(); - /* - * @return scaleTime - */ - double getScale(); - - /* - * if the actual index is not the maximum index - */ - bool hasNextIndex(); - /* - * if the actual index is not zero - */ - bool hasPreviousIndex(); - - /* - * Get initial time - */ - double getInitialTime(); - - - //====== ACCESS ========== - /* - * Sets the name of the concept - * @param name, new name - */ - void setName(std::string name); - /* - * Sets the position of the concept - * @param position - */ - void setPosition(int position); - /* - * Sets the mode of the concept - * @param mode, new mode= REAL_TIME or - * PLUS_PLUS - */ - void setMode(int mode); - /* - * Set Increase of the concept - * @param increaseValue - */ - void setIncreaseValue(int increaseValue); - - /* - * Set decrease of the concept - * @param decreaseValue - */ - void setDecreaseValue(int decreaseValue); - - /* - * Sets the index of the concept in the instant - * @param indexInInstant - */ - void setIndexInInstant(int indexInInstant); - /* - * Sets sets the maximum value - * @param maximumIndex - */ - void setMaximumIndex(int maximumIndex); - /* - * set the actualIndex - * @param index - */ - void setActualIndex(int index); - /* - * set the timeReproduction - * @param time - */ - void setTimeReproduction(double time); - /* - * set the scaleTime - * @param scale - */ - void setScale(double scale); - /* - * set the actualTime - * @param actualTime - */ - void setActualTime(double actualTime); - /* - * reset the initial time - */ - void resetInitialTime(); - /* - * Sets the initial time - */ - void setInitialTime(double time); - - - private: - - //======= ATTRIBUTES======= - - /* - * Name of the concept - */ - std::string name; - /* - * Mode of changing the instant - * REAL_TIME - * PLUS_PLUS - */ - int mode; - - /* - * position in the reproduction - */ - int positionInReproduction; - /* - * Increment for an instant - * for default is 1 - */ - int increaseValue; - /* - * Decrease for an instant - * for default is 1 - */ - int decreaseValue; - /* - * index in Instant - */ - int indexInInstant; - /* - * index that it is - */ - int actualIndex; - /* - * maximum index that can have in the instant - */ - int maximumIndex; - /* - * Time in miliseconds of the reproduction - */ - double timeReproduction; - /* - * Scale use for calculate the index - * of the concept according to the time of reproduction - * defined in timeReproduction - * scaleTime=maximumIndex/timeReproduction - */ - double scaleTime; - /* - * actual time of the reproduction - * is in miliseconds - */ - double actualTime; - /* - * Initial time - * is in miliseconds - */ - double initialTime; - - - - //====== PRIVATE METHODS========= - - - }; +{ +public: + //===== CONSTANTS ======== + /* + * if the concept is being reproduced in real time + */ + const static int REAL_TIME=1; + /* + * if the concept is being reproduced by doing + * plus plus to its indexes + */ + const static int PLUS_PLUS=2; + + + //====== LIFECYCLE ======== + ConceptInstantHandler(std::string name,int mode,int positionInReproduction); + ~ConceptInstantHandler(); + //====== OPERATIONS ======= + /* + * change the actual index by increasing + * the index until the maximum by the increaseValue + */ + void nextIndex(); + /* + * change the actual index by decreasing + * the index until zero by the decreaseValue + */ + void previousIndex(); + + //====== INQUIRY ========= + /* + * @return name + */ + std::string getName(); + /* + * @return PositionInReproduction + */ + int getPosition(); + /* + * @return mode + */ + int getMode(); + /* + * @return increaseValue + */ + int getIncreaseValue(); + + /* + * @return decreaseValue + */ + int getDecreaseValue(); + + /* + * @return indexInInstant + */ + int getIndexInInstant(); + /* + * @return actualIndex +*/ + int geActualIndex(); + /* + * @return maximumIndex + */ + + int getMaximumIndex(); + /* + * @return timeReproduction + */ + double getTimeReproduction(); + /* + * @return scaleTime + */ + double getScale(); + + /* + * if the actual index is not the maximum index + */ + bool hasNextIndex(); + /* + * if the actual index is not zero + */ + bool hasPreviousIndex(); + + /* + * Get initial time + */ + double getInitialTime(); + + + //====== ACCESS ========== + /* + * Sets the name of the concept + * @param name, new name + */ + void setName(std::string name); + /* + * Sets the position of the concept + * @param position + */ + void setPosition(int position); + /* + * Sets the mode of the concept + * @param mode, new mode= REAL_TIME or + * PLUS_PLUS + */ + void setMode(int mode); + /* + * Set Increase of the concept + * @param increaseValue + */ + void setIncreaseValue(int increaseValue); + + /* + * Set decrease of the concept + * @param decreaseValue + */ + void setDecreaseValue(int decreaseValue); + + /* + * Sets the index of the concept in the instant + * @param indexInInstant + */ + void setIndexInInstant(int indexInInstant); + /* + * Sets sets the maximum value + * @param maximumIndex + */ + void setMaximumIndex(int maximumIndex); + /* + * set the actualIndex + * @param index + */ + void setActualIndex(int index); + /* + * set the timeReproduction + * @param time + */ + void setTimeReproduction(double time); + /* + * set the scaleTime + * @param scale + */ + void setScale(double scale); + /* + * set the actualTime + * @param actualTime + */ + void setActualTime(double actualTime); + /* + * reset the initial time + */ + void resetInitialTime(); + /* + * Sets the initial time + */ + void setInitialTime(double time); + + + private: + + //======= ATTRIBUTES======= + + /* + * Name of the concept + */ + std::string name; + /* + * Mode of changing the instant + * REAL_TIME + * PLUS_PLUS + */ + int mode; + + /* + * position in the reproduction + */ + int positionInReproduction; + /* + * Increment for an instant + * for default is 1 + */ + int increaseValue; + /* + * Decrease for an instant + * for default is 1 + */ + int decreaseValue; + /* + * index in Instant + */ + int indexInInstant; + /* + * index that it is + */ + int actualIndex; + /* + * maximum index that can have in the instant + */ + int maximumIndex; + /* + * Time in miliseconds of the reproduction + */ + double timeReproduction; + /* + * Scale use for calculate the index + * of the concept according to the time of reproduction + * defined in timeReproduction + * scaleTime=maximumIndex/timeReproduction + */ + double scaleTime; + /* + * actual time of the reproduction + * is in miliseconds + */ + double actualTime; + /* + * Initial time + * is in miliseconds + */ + double initialTime; + + //====== PRIVATE METHODS========= + + + }; #endif