deskflow/src/lib/base/FunctionJob.h

30 lines
607 B
C
Raw Normal View History

2012-06-10 16:50:54 +00:00
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
2012-06-10 16:50:54 +00:00
*/
#pragma once
2012-06-10 16:50:54 +00:00
#include "base/IJob.h"
2012-06-10 16:50:54 +00:00
//! Use a function as a job
/*!
A job class that invokes a function.
*/
class FunctionJob : public IJob
{
2012-06-10 16:50:54 +00:00
public:
//! run() invokes \c func(arg)
FunctionJob(void (*func)(void *), void *arg = NULL);
~FunctionJob() override;
2012-06-10 16:50:54 +00:00
// IJob overrides
void run() override;
2012-06-10 16:50:54 +00:00
private:
void (*m_func)(void *);
void *m_arg;
2012-06-10 16:50:54 +00:00
};