Changeset 7990 in orxonox.OLD for branches/gui
- Timestamp:
- May 30, 2006, 9:07:10 PM (19 years ago)
- Location:
- branches/gui/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl_gui/signal_connector.cc
r7985 r7990 64 64 } 65 65 66 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1) const 67 { 68 if (exec != NULL && object != NULL) 69 { 70 MultiType mt[] = { value0, value1 }; 71 (*this->exec)(this->object, 2, mt); 72 } 73 } 74 75 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2) const 76 { 77 if (exec != NULL && object != NULL) 78 { 79 MultiType mt[] = { value0, value1, value2 }; 80 (*this->exec)(this->object, 3, mt); 81 } 82 } 83 84 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3) const 85 { 86 if (exec != NULL && object != NULL) 87 { 88 MultiType mt[] = { value0, value1, value2, value3 }; 89 (*this->exec)(this->object, 4, mt); 90 } 91 } 92 93 void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3, const MultiType& value4) const 94 { 95 if (exec != NULL && object != NULL) 96 { 97 MultiType mt[] = { value0, value1, value2, value3, value4 }; 98 (*this->exec)(this->object, 5, mt); 99 } 100 } 66 101 } -
branches/gui/src/lib/gui/gl_gui/signal_connector.h
r7985 r7990 40 40 41 41 /** 42 * @brief declares a new Signal.43 * @param SignalName the Name of the Signal.42 * @brief declares a new Signal. 43 * @param SignalName the Name of the Signal. 44 44 */ 45 45 #define DeclareSignal1(SignalName, param0) \ … … 49 49 SignalName ## connected[i] (val0); \ 50 50 }\ 51 DeclareSignalEnd(SignalName) 52 53 /** 54 * @brief declares a new Signal. 55 * @param SignalName the Name of the Signal. 56 */ 57 #define DeclareSignal2(SignalName, param0, param1) \ 58 DeclareSignalBegin(SignalName) \ 59 void SignalName (param0 val0, param1 val1) { \ 60 for (unsigned int i = 0; i < SignalName ## connected .size(); i++) \ 61 SignalName ## connected[i] (val0, val1); \ 62 }\ 51 63 DeclareSignalEnd(SignalName) 52 64 … … 85 97 void operator()() const; 86 98 void operator()(const MultiType& value0) const; 99 void operator()(const MultiType& value0, const MultiType& value1) const; 100 void operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2) const; 101 void operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3) const; 102 void operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3, const MultiType& value4) const; 87 103 88 104 bool isValid() const { return (this->object && this->exec); }; -
branches/gui/src/lib/util/executor/executor_functional.h
r7985 r7990 163 163 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 164 164 { 165 switch(count) 166 { 167 case 0: 168 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(fromMulti<type0>(this->defaultValue[0])); 169 default: 170 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(fromMulti<type0>(values[0])); 171 } 165 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 166 fromMulti<type0>((count > 0)? values[0] : this->defaultValue[0]) ); 172 167 } 173 168 … … 180 175 virtual void operator()(BaseObject* object, const SubString& sub = SubString()) const 181 176 { 182 183 /* // THE VERY COOL DEBUG184 printf("SUB[0] : %s\n", sub[0].c_str());185 printf("getDefault<type0>(this->defaultValue, 0):::: %d\n", getDefault<type0>(this->defaultValue, 0));186 printf("VALUE: %d\n", fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)));187 */188 177 (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 189 178 fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) ); … … 236 225 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 237 226 { 227 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 228 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]), 229 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]) ); 238 230 } 239 231 … … 286 278 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 287 279 { 280 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 281 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]), 282 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]), 283 fromMulti<type2>((count > 2) ? values[2] : this->defaultValue[2]) ); 288 284 } 289 285 … … 338 334 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 339 335 { 336 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 337 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]), 338 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]), 339 fromMulti<type2>((count > 2) ? values[2] : this->defaultValue[2]), 340 fromMulti<type3>((count > 3) ? values[3] : this->defaultValue[3]) ); 340 341 } 341 342 … … 391 392 virtual void operator()(BaseObject* object, unsigned int count, const MultiType* values) const 392 393 { 394 return (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)( 395 fromMulti<type0>((count > 0) ? values[0] : this->defaultValue[0]), 396 fromMulti<type1>((count > 1) ? values[1] : this->defaultValue[1]), 397 fromMulti<type2>((count > 2) ? values[2] : this->defaultValue[2]), 398 fromMulti<type3>((count > 3) ? values[3] : this->defaultValue[3]), 399 fromMulti<type4>((count > 4) ? values[4] : this->defaultValue[4]) ); 393 400 } 394 401
Note: See TracChangeset
for help on using the changeset viewer.