- Timestamp:
- May 30, 2006, 9:29:25 PM (18 years ago)
- Location:
- branches/gui/src/lib/gui/gl_gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl_gui/signal_connector.cc
r7990 r7992 21 21 { 22 22 23 /** 24 * @brief creates a clean SignalConnector 25 */ 23 26 SignalConnector::SignalConnector( ) 24 27 { … … 27 30 } 28 31 32 /** 33 * @brief Creates a SignalConnector out of an ObjectPointer, and an Executor. 34 * @param object the Object the Executor will apply to. 35 * @param executor the Executor that will be executed. 36 * @return a new SignalConnector. 37 */ 29 38 SignalConnector::SignalConnector(BaseObject* object, const Executor* executor) 30 39 { … … 33 42 }; 34 43 44 /** 45 * @brief Creates a SignalConnector as a copy of another one. 46 * @param signalConnector The SignalConnector to copy. 47 */ 35 48 SignalConnector::SignalConnector(const SignalConnector& signalConnector) 36 49 { … … 39 52 } 40 53 54 /** 55 * @brief deletes a SignalConnector. 56 * 57 * frees the stored executor 58 */ 41 59 SignalConnector::~SignalConnector() 42 60 { … … 52 70 53 71 72 /** 73 * @brief Executes the SignalConnector. 74 */ 54 75 void SignalConnector::operator()() const 55 76 { … … 58 79 } 59 80 81 /** 82 * @brief Executes the SignalConnector. 83 * @param value0 First Value. 84 */ 60 85 void SignalConnector::operator()(const MultiType& value0) const 61 86 { … … 64 89 } 65 90 91 /** 92 * @brief Executes the SignalConnector. 93 * @param value0 First Value 94 * @param value1 Second Value 95 */ 66 96 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1) const 67 97 { … … 73 103 } 74 104 105 /** 106 * @brief Executes the SignalConnector. 107 * @param value0 First Value 108 * @param value1 Second Value 109 * @param value2 Third Value 110 */ 75 111 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2) const 76 112 { … … 82 118 } 83 119 120 /** 121 * @brief Executes the SignalConnector. 122 * @param value0 First Value 123 * @param value1 Second Value 124 * @param value2 Third Value 125 * @param value3 Fourth Value 126 */ 84 127 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3) const 85 128 { … … 91 134 } 92 135 136 /** 137 * @brief Executes the SignalConnector. 138 * @param value0 First Value 139 * @param value1 Second Value 140 * @param value2 Third Value 141 * @param value3 Fourth Value 142 * @param value3 Fifth Value 143 */ 93 144 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3, const MultiType& value4) const 94 145 { -
branches/gui/src/lib/gui/gl_gui/signal_connector.h
r7991 r7992 23 23 #define DeclareSignalEnd(SignalName) \ 24 24 Signal SignalName ## connected 25 /////////////////////////////////////////////25 ///////////////////////////////////////////// 26 26 27 27 … … 42 42 * @brief declares a new Signal. 43 43 * @param SignalName the Name of the Signal. 44 * @param param0 the first Parameter the Function takes 44 45 */ 45 46 #define DeclareSignal1(SignalName, param0) \ … … 52 53 53 54 /** 54 * @brief declares a new Signal. 55 * @param SignalName the Name of the Signal. 55 * @brief declares a new Signal. 56 * @param SignalName the Name of the Signal. 57 * @param param0 the first Parameter the Function takes 58 * @param param1 the second Parameter the Function takes 56 59 */ 57 60 #define DeclareSignal2(SignalName, param0, param1) \ … … 68 71 * @brief declares a new Signal. 69 72 * @param SignalName the Name of the Signal. 73 * @param param0 the first Parameter the Function takes 74 * @param param1 the second Parameter the Function takes 75 * @param param2 the third Parameter the Function takes 70 76 */ 71 77 #define DeclareSignal3(SignalName, param0, param1, param2) \ … … 80 86 * @brief declares a new Signal. 81 87 * @param SignalName the Name of the Signal. 88 * @param param0 the first Parameter the Function takes 89 * @param param1 the second Parameter the Function takes 90 * @param param2 the third Parameter the Function takes 91 * @param param3 the fourth Parameter the Function takes 82 92 */ 83 93 #define DeclareSignal4(SignalName, param0, param1, param2, param3) \ … … 93 103 * @brief declares a new Signal. 94 104 * @param SignalName the Name of the Signal. 105 * @param param0 the first Parameter the Function takes 106 * @param param1 the second Parameter the Function takes 107 * @param param2 the third Parameter the Function takes 108 * @param param4 the fifth Parameter the Function takes 95 109 */ 96 110 #define DeclareSignal5(SignalName, param0, param1, param2, param3, param4) \ … … 103 117 104 118 105 106 107 108 119 /** 120 * @brief selects a Signal. 121 * @param SignalName the Signal to be retrieved. 122 */ 109 123 #define SIGNAL(Object, SignalName) \ 110 124 Object->getSignalVector_##SignalName() 111 125 112 /**113 * @brief defines a Slot, the sink of a Signal.114 * @param Class the Class the Slot belongs to.115 * @param function the Function to Connect to.116 */126 /** 127 * @brief defines a Slot, the sink of a Signal. 128 * @param Class the Class the Slot belongs to. 129 * @param function the Function to Connect to. 130 */ 117 131 #define SLOT(Class, function) \ 118 132 createExecutor<Class>(&Class::function) 119 133 120 /**121 * @brief emits function122 */134 /** 135 * @brief emits function 136 */ 123 137 #define emit(function) function 124 138 125 //! A class for Conncting Signals to Objects, inside of the GUI 139 //! A class for Conncting Signals to Objects, inside of the Graphical user interface. 140 /** 141 * The SignalConnector binds an Object to a Functional (Executor) 142 * The Usage is quite easy in the Widget for this: 143 * 144 * int the header (Class Definition) you can add a definition of a Signal with: 145 * @verbatim DeclareSignal3(my_signal, int, int, float) 146 * and a Signal with the the Parameters int,int and float will be created. 147 * 148 * now you can use the connect function of GLWidget to connect this Signal to a Slot. 149 * @see GLGuiWidget::connect 150 */ 126 151 class SignalConnector 127 152 { … … 133 158 134 159 SignalConnector& operator=(const SignalConnector& signalConnector); 160 bool operator==(const SignalConnector& signalConnector); 135 161 136 162 void operator()() const; … … 141 167 void operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3, const MultiType& value4) const; 142 168 169 /** checks wether the SignalConnector is valid @return true on valid. */ 143 170 bool isValid() const { return (this->object && this->exec); }; 171 /** @brief checks if the SignalConnector is clean, invalid @returns true if invalid */ 144 172 bool isClean() const { return (this->object == NULL || this->exec == NULL); } 145 173 … … 150 178 }; 151 179 180 //! TypeDefinition for SignalLists 152 181 typedef std::vector<SignalConnector> Signal; 182 //! TypeDefinition for a Slot. 153 183 typedef Executor* Slot; 154 184
Note: See TracChangeset
for help on using the changeset viewer.