| Line |  | 
|---|
| 1 | /* | 
|---|
| 2 | * synergy -- mouse and keyboard sharing utility | 
|---|
| 3 | * Copyright (C) 2002 Chris Schoeneman | 
|---|
| 4 | * | 
|---|
| 5 | * This package is free software; you can redistribute it and/or | 
|---|
| 6 | * modify it under the terms of the GNU General Public License | 
|---|
| 7 | * found in the file COPYING that should have accompanied this file. | 
|---|
| 8 | * | 
|---|
| 9 | * This package is distributed in the hope that it will be useful, | 
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 12 | * GNU General Public License for more details. | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 | #ifndef CFUNCTIONJOB_H | 
|---|
| 16 | #define CFUNCTIONJOB_H | 
|---|
| 17 |  | 
|---|
| 18 | #include "IJob.h" | 
|---|
| 19 |  | 
|---|
| 20 | //! Use a function as a job | 
|---|
| 21 | /*! | 
|---|
| 22 | A job class that invokes a function. | 
|---|
| 23 | */ | 
|---|
| 24 | class CFunctionJob : public IJob { | 
|---|
| 25 | public: | 
|---|
| 26 | //! run() invokes \c func(arg) | 
|---|
| 27 | CFunctionJob(void (*func)(void*), void* arg = NULL); | 
|---|
| 28 | virtual ~CFunctionJob(); | 
|---|
| 29 |  | 
|---|
| 30 | // IJob overrides | 
|---|
| 31 | virtual void            run(); | 
|---|
| 32 |  | 
|---|
| 33 | private: | 
|---|
| 34 | void                            (*m_func)(void*); | 
|---|
| 35 | void*                           m_arg; | 
|---|
| 36 | }; | 
|---|
| 37 |  | 
|---|
| 38 | #endif | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.