| | 189 | |
| | 190 | |
| | 191 | === ''' System Queue ''' === |
| | 192 | |
| | 193 | Instead of implementing `ariba::utility::SystemEventListener` and multiplex different events in the `handleSystemEvent` callback, it's now possible to schedule a function call into the System Queue, using boost::bind. |
| | 194 | |
| | 195 | This may look like this: |
| | 196 | |
| | 197 | {{{ |
| | 198 | #!cpp |
| | 199 | void MyClass::some_function() |
| | 200 | { |
| | 201 | string param1 = "hello"; |
| | 202 | int param2 = 5; |
| | 203 | |
| | 204 | // schedule call of "myfunction(param1, param2)" into System Queue |
| | 205 | SystemQueue::instance().scheduleCall( |
| | 206 | boost::bind( |
| | 207 | &MyClass::myfunction, |
| | 208 | this, |
| | 209 | param1, |
| | 210 | param2) |
| | 211 | ); |
| | 212 | } |
| | 213 | |
| | 214 | void MyClass::myfunction(string param1, int param2) |
| | 215 | { |
| | 216 | // do something |
| | 217 | } |
| | 218 | }}} |
| | 219 | |
| | 220 | Also `SystemQueue::scheduleCall` takes an optional second parameter `uint32_t delay`, to schedule a callback `delay` milli-seconds in the future. |