]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/ExecutableCommand.cxx
dd6a3361bc9c4dd4fc13ebc58b8959af26f110a4
[creaContours.git] / lib / kernel_ManagerContour_NDimensions / ExecutableCommand.cxx
1
2 //----------------------------------------------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------------------------------------------
5 #include "ExecutableCommand.h"
6
7 //----------------------------------------------------------------------------------------------------------------
8 // Class implementation
9 //----------------------------------------------------------------------------------------------------------------
10 /** @file ExecutableCommand.cxx */
11
12 //------------------------------------------------------------------------------------------------------------
13 // Constructors & Destructors
14 //------------------------------------------------------------------------------------------------------------
15
16         /*
17         * Creates a command with the given text
18         * @param aText Is the text to assign to the command
19         * @return Returns the created ExecutableCommand pointer
20         */
21         ExecutableCommand :: ExecutableCommand(std::string aText)
22         { 
23                 setText(aText); 
24                 std::cout<<"execComm created "<< aText.data()<<std::endl;//SIL
25         }
26
27         /*
28         * Destroys the command
29         */
30         ExecutableCommand :: ~ExecutableCommand()
31         { 
32                 clear();
33         }
34
35         
36
37 //------------------------------------------------------------------------------------------------------------
38 // Methods
39 //------------------------------------------------------------------------------------------------------------
40
41         /*
42         * Gets the text of the command
43         * @return text Is the text of the command
44         */
45         std::string ExecutableCommand :: getText()
46         {
47                 return text;
48         }
49
50         /*
51         * Sets the text of the command
52         * @param theText Is the text of the command
53         */
54         void ExecutableCommand :: setText(std::string theText)
55         { 
56                 text = theText;
57         }
58         
59         /*
60         * Includes the command into the given queue for execution
61         * @param executionQueue Is the queue in which is included the command
62         */
63         void ExecutableCommand :: includeToExecute(std::deque<CommandObject *> & executionQueue)
64         {
65                 executionQueue.push_back( this );
66         }
67
68
69         /*
70         * Virtual method implementation that returns 1 as the ExecutableCommand is just one command effective
71         * @return The value of commands that represents this
72         */
73         int ExecutableCommand :: count()
74         {
75                 return 1;
76         }
77
78         /*
79         * Method that clears the command
80         */
81         void ExecutableCommand :: clear()
82         {
83                 
84         }